GeneratedPropertyEntity entity = new GeneratedPropertyEntity();
entity.setName( "entity-1" );
Session s = openSession();
Transaction t = s.beginTransaction();
s.save( entity );
s.flush();
assertNotNull( "no timestamp retrieved", entity.getLastModified() );
t.commit();
s.close();
byte[] bytes = entity.getLastModified();
s = openSession();
t = s.beginTransaction();
entity = ( GeneratedPropertyEntity ) s.get( GeneratedPropertyEntity.class, entity.getId() );
assertTrue( Hibernate.BINARY.isEqual( bytes, entity.getLastModified() ) );
t.commit();
s.close();
assertTrue( Hibernate.BINARY.isEqual( bytes, entity.getLastModified() ) );
s = openSession();
t = s.beginTransaction();
s.delete( entity );
t.commit();
s.close();