Examples of Employment


Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");
    Serializable orgId = s.save(jboss);
    Serializable orgId2 = s.save(ifa);
    s.save(gavin);
    s.save(emp);
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    List list = s.createSQLQuery( getEmploymentSQL() )
        .addEntity( Employment.class.getName() )
        .list();
    assertEquals( 1,list.size() );

    Employment emp2 = (Employment) list.get(0);
    assertEquals(emp2.getEmploymentId(), emp.getEmploymentId() );
    assertEquals(emp2.getStartDate().getDate(), emp.getStartDate().getDate() );
    assertEquals(emp2.getEndDate(), emp.getEndDate() );

    s.clear();

    list = s.createSQLQuery( getEmploymentSQL() )
    .addEntity( Employment.class.getName() )
View Full Code Here

Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");

    s.persist(ifa);
    s.persist(jboss);
    s.persist(gavin);
    s.persist(emp);
View Full Code Here

Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");

    s.persist(ifa);
    s.persist(jboss);
    s.persist(gavin);
    s.persist(emp);
View Full Code Here

Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");
    Serializable orgId = s.save(jboss);
    Serializable orgId2 = s.save(ifa);
    s.save(gavin);
    s.save(emp);
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    Query namedQuery = s.getNamedQuery("AllEmploymentAsMapped");
    List list = namedQuery.list();
    assertEquals(1,list.size());
    Employment emp2 = (Employment) list.get(0);
    assertEquals(emp2.getEmploymentId(), emp.getEmploymentId() );
    assertEquals(emp2.getStartDate().getDate(), emp.getStartDate().getDate() );
    assertEquals(emp2.getEndDate(), emp.getEndDate() );
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
View Full Code Here

Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");
    Serializable orgId = s.save(jboss);
    Serializable orgId2 = s.save(ifa);
    s.save(gavin);
    s.save(emp);
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    List list = s.createSQLQuery( getEmploymentSQL() )
        .addEntity( Employment.class.getName() )
        .list();
    assertEquals( 1,list.size() );

    Employment emp2 = (Employment) list.get(0);
    assertEquals(emp2.getEmploymentId(), emp.getEmploymentId() );
    assertEquals(emp2.getStartDate().getDate(), emp.getStartDate().getDate() );
    assertEquals(emp2.getEndDate(), emp.getEndDate() );

    s.clear();

    list = s.createSQLQuery( getEmploymentSQL() )
    .addEntity( Employment.class.getName() )
View Full Code Here

Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");

    s.persist(ifa);
    s.persist(jboss);
    s.persist(gavin);
    s.persist(emp);
View Full Code Here

Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");

    s.persist(ifa);
    s.persist(jboss);
    s.persist(gavin);
    s.persist(emp);
View Full Code Here

Examples of org.hibernate.test.sql.hand.Employment

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Organization ifa = new Organization("IFA");
    Organization jboss = new Organization("JBoss");
    Person gavin = new Person("Gavin");
    Employment emp = new Employment(gavin, jboss, "AU");
    Serializable orgId = s.save(jboss);
    Serializable orgId2 = s.save(ifa);
    s.save(gavin);
    s.save(emp);
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    Query namedQuery = s.getNamedQuery("AllEmploymentAsMapped");
    List list = namedQuery.list();
    assertEquals(1,list.size());
    Employment emp2 = (Employment) list.get(0);
    assertEquals(emp2.getEmploymentId(), emp.getEmploymentId() );
    assertEquals(emp2.getStartDate().getDate(), emp.getStartDate().getDate() );
    assertEquals(emp2.getEndDate(), emp.getEndDate() );
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
View Full Code Here

Examples of org.joget.directory.model.Employment

        }
    }

    public Boolean deleteEmployment(String id) {
        try {
            Employment employment = getEmployment(id);

            if (employment != null) {
                // clear department HOD
                Department dept = employment.getDepartment();
                if (dept != null) {
                    Employment hod = dept.getHod();
                    if (hod != null && id.equals(hod.getId())) {
                        dept.setHod(null);
                        departmentDao.updateDepartment(dept);
                    }
                }
               
View Full Code Here

Examples of org.joget.directory.model.Employment

        User user = getUserByUsername(username);
        if (user != null && user.getEmployments() != null) {
            Collection<Employment> employments = user.getEmployments();

            //get only 1st employment record, currently only support 1 employment per user
            Employment employment = employments.iterator().next();

            if (employment.getEmploymentReportTo() != null) {
                EmploymentReportTo employmentReportTo = employment.getEmploymentReportTo();
                userList.add(employmentReportTo.getReportTo().getUser());
            } else {
                Department dept = employment.getDepartment();
                User hod = getDepartmentHod(dept.getId());
               
                if (hod != null) {
                    userList.add(hod);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.