Beispiel #1
0
 public void assertCanBeReloadedWithSameState(final Object original) throws Exception {
   perform(
       new UnitOfWork() {
         public void work(Session session) throws Exception {
           Object loaded = session.get(original.getClass(), idOf(original));
           assertThat("entity", loaded, samePersistentFieldsAs(original));
         }
       });
 }
Beispiel #2
0
 public void persist(final Object... entities) throws Exception {
   for (final Object entity : entities) {
     perform(
         new UnitOfWork() {
           public void work(Session session) throws Exception {
             session.save(entity);
           }
         });
   }
   makeSureSubsequentLoadOperationsHitTheDatabase();
 }