/** * The main bugaboo with IdentityMap that warranted this class in the first place. * * Return an array of all the entity/EntityEntry pairs in this context. The array is to make sure * that the iterators built off of it are safe from concurrency/reentrancy * * @return The safe array */ public Map.Entry<Object, EntityEntry>[] reentrantSafeEntityEntries() { if ( dirty ) { reentrantSafeEntries = new EntityEntryCrossRefImpl[count]; int i = 0; ManagedEntity managedEntity = head; while ( managedEntity != null ) { reentrantSafeEntries[i++] = new EntityEntryCrossRefImpl( managedEntity.$$_hibernate_getEntityInstance(), managedEntity.$$_hibernate_getEntityEntry() ); managedEntity = managedEntity.$$_hibernate_getNextManagedEntity(); } dirty = false; } return reentrantSafeEntries; }
@Override public Object getKey() { return getEntity(); }
@Override public EntityEntry getValue() { return getEntityEntry(); }
/** * The main bugaboo with IdentityMap that warranted this class in the first place. * * Return an array of all the entity/EntityEntry pairs in this context. The array is to make sure * that the iterators built off of it are safe from concurrency/reentrancy * * @return The safe array */ public Map.Entry<Object, EntityEntry>[] reentrantSafeEntityEntries() { if ( dirty ) { reentrantSafeEntries = new EntityEntryCrossRefImpl[count]; int i = 0; ManagedEntity managedEntity = head; while ( managedEntity != null ) { reentrantSafeEntries[i++] = new EntityEntryCrossRefImpl( managedEntity.$$_hibernate_getEntityInstance(), managedEntity.$$_hibernate_getEntityEntry() ); managedEntity = managedEntity.$$_hibernate_getNextManagedEntity(); } dirty = false; } return reentrantSafeEntries; }
@Override public EntityEntry getValue() { return getEntityEntry(); }
@Override public Object getKey() { return getEntity(); }