@Test public void testCopyAssociatedWithNewAndExistingEntity() { session.getTransaction().begin(); Simple entity = new Simple( 1 ); Simple copy = new Simple( 0 ); session.persist( entity ); cache.put(entity, copy); session.flush(); try { cache.put( new Simple( 1 ), copy ); fail( "should have thrown IllegalStateException"); } catch( IllegalStateException ex ) { assertTrue( ex.getMessage().startsWith( "Error occurred while storing entity [org.hibernate.event.internal.EventCacheTest$Simple@" ) ); } session.getTransaction().rollback(); }
public Object put(Object entity, Object copy) { return put( entity, copy, Boolean.FALSE ); }
EventCache implements Map { public Object put(Object entity, Object copy) { return put( entity, copy, Boolean.FALSE ); } }
EventCache implements Map { public Object put(Object entity, Object copy) { return put( entity, copy, Boolean.FALSE ); } EventCache(EventSource session); }
EventCache implements Map { public Object put(Object entity, Object copy) { return put( entity, copy, Boolean.FALSE ); } EventCache(EventSource session); void clear(); boolean containsKey(Object entity); boolean containsValue(Object copy); Set entrySet(); Object get(Object entity); boolean isEmpty(); Set keySet(); Object put(Object entity, Object copy); void putAll(Map map); Object remove(Object entity); int size(); Collection values(); boolean isOperatedOn(Object entity); Map invertMap(); }
EventCache implements Map { public Object put(Object entity, Object copy) { return put( entity, copy, Boolean.FALSE ); } EventCache(EventSource session); void clear(); boolean containsKey(Object entity); boolean containsValue(Object copy); Set entrySet(); Object get(Object entity); boolean isEmpty(); Set keySet(); Object put(Object entity, Object copy); void putAll(Map map); Object remove(Object entity); int size(); Collection values(); boolean isOperatedOn(Object entity); Map invertMap();  }