Package org.wicketTutorial.model

Examples of org.wicketTutorial.model.JpaLoadableModel.detach()


    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


    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());   
  }
 
  @Test
View Full Code Here

   
    entityManager.getTransaction().begin();
    entityManager.persist(person);
    entityManager.getTransaction().commit();
   
    model.detach();
   
    Assert.assertEquals(person.getId(), model.getObject().getId())
  }
 
  @Test
View Full Code Here

    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();
View Full Code Here

   
    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.