@Test public void testCopyAssociatedWith2ExistingEntities() { session.getTransaction().begin(); Simple entity1 = new Simple( 1 ); session.persist( entity1 ); Simple copy1 = new Simple( 1 ); cache.put(entity1, copy1); Simple entity2 = new Simple( 2 ); session.persist( entity2 ); Simple copy2 = new Simple( 2 ); cache.put( entity2, copy2 ); session.flush(); try { cache.put( entity1, copy2 ); fail( "should have thrown IllegalStateException"); } catch( IllegalStateException ex ) { assertTrue( ex.getMessage().startsWith( "Error occurred while storing entity [org.hibernate.event.internal.EventCacheTest$Simple#1]." ) ); } 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();  }