Examples of JpaLoadableModel


Examples of org.wicketTutorial.model.JpaLoadableModel

    entityManager.persist(person);
    entityManager.getTransaction().commit();
   
    PersistenceUnitUtil util = entityManagerFactory.getPersistenceUnitUtil();
   
    JpaLoadableModel<Person> model = new JpaLoadableModel(entityManagerFactory, person);
    model.detach();
   
    Assert.assertNotNull(model.getObject())
    Assert.assertEquals(person.getId(), model.getObject().getId());   
  }
View Full Code Here

Examples of org.wicketTutorial.model.JpaLoadableModel

  }
 
  @Test
  public void testTransientEntity() throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException{
    Person person = new Person("Phill", "Griffin", "pgriffin@gmail.com");
    JpaLoadableModel<Person> model = new JpaLoadableModel(entityManagerFactory, person);
   
    Assert.assertNotNull(model.getObject());
   
    model.detach();
   
    Assert.assertNull(model.getObject());   
  }
View Full Code Here

Examples of org.wicketTutorial.model.JpaLoadableModel

  }
 
  @Test
  public void testPersistTransientEntity(){
    Person person = new Person("Bill", "Smith", "bsmith@gmail.com");
    JpaLoadableModel<Person> model = new JpaLoadableModel(entityManagerFactory, person);
   
    entityManager.getTransaction().begin();
    entityManager.persist(person);
    entityManager.getTransaction().commit();
   
    model.detach();
   
    Assert.assertEquals(person.getId(), model.getObject().getId())
  }
View Full Code Here

Examples of org.wicketTutorial.model.JpaLoadableModel

   
    entityManager.getTransaction().begin();
    entityManager.persist(person);
    entityManager.getTransaction().commit();
   
    JpaLoadableModel<Person> model = new JpaLoadableModel(entityManagerFactory, person);
   
    model.detach();
    Assert.assertNotNull(model.getObject());
   
    entityManager.getTransaction().begin();
    entityManager.remove(person);
    entityManager.getTransaction().commit();
   
    model.detach();
    Assert.assertNull(model.getObject());
   
  }
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.