Package org.apache.openjpa.persistence.inheritance.entity

Examples of org.apache.openjpa.persistence.inheritance.entity.Manager


    super.setUp(CLEAR_TABLES, Department.class, Employee.class,
        PTEmployee.class, FTEmployee.class, Manager.class);

    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
        Manager m = new Manager();
        m.setId(1);
        m.setFirstName("mf1");
        m.setLastName("ml1");
        m.setSalary(1000000);
        m.setVacationDays(20);
               
        Department d = new Department();
        d.setId(1);
        d.setDepartmentName("d1");
        d.setDepartmentManager(m);
        m.setDepartment(d);
       
        Employee e1 = new Employee();
        e1.setId(2);
        e1.setFirstName("ef1");
        e1.setLastName("el1");
View Full Code Here


    em.close();
  }

  public void testFindEntity() {
    EntityManager em1 = emf.createEntityManager();
        Manager m = em1.find(Manager.class, 1);
        assertNotNull(m);
    em1.close();
  }
View Full Code Here

    public void test() throws Exception {
        EntityManager em = emf.createEntityManager();
        try {
            // Create a manager and a department
            em.getTransaction().begin();
            Manager m = new Manager();
            m.setId(1);
            em.persist(m);
            Department dept = new Department();
            dept.setId(1);
            dept.setDepartmentManager(m);
            em.persist(dept);
            m.setDepartment(dept);
            em.getTransaction().commit();
            em.clear();

            emf.getCache().evictAll();
View Full Code Here

    super.setUp(CLEAR_TABLES, Department.class, Employee.class,
        PTEmployee.class, FTEmployee.class, Manager.class);

    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
        Manager m = new Manager();
        m.setId(1);
        m.setFirstName("mf1");
        m.setLastName("ml1");
        m.setSalary(1000000);
        m.setVacationDays(20);
               
        Department d = new Department();
        d.setId(1);
        d.setDepartmentName("d1");
        d.setDepartmentManager(m);
        m.setDepartment(d);
       
        Employee e1 = new Employee();
        e1.setId(2);
        e1.setFirstName("ef1");
        e1.setLastName("el1");
View Full Code Here

    // problem deleting table in MySQL
  }

  public void testFindEntity() {
    EntityManager em1 = emf.createEntityManager();
        Manager m = em1.find(Manager.class, 1);
        assertNotNull(m);
    em1.close();
  }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.inheritance.entity.Manager

Copyright © 2018 www.massapicom. 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.