@Override public void checkUniqueness(EntityKey key, Object object) throws HibernateException { final Object entity = getEntity( key ); if ( entity == object ) { throw new AssertionFailure( "object already associated, but no entry was found" ); } if ( entity != null ) { throw new NonUniqueObjectException( key.getIdentifier(), key.getEntityName() ); } }
@Override public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException { checkOpenOrWaitingForAutoClose(); // todo : should this get moved to PersistentContext? // logically, is PersistentContext the "thing" to which an interceptor gets attached? final Object result = persistenceContext.getEntity( key ); if ( result == null ) { final Object newObject = getInterceptor().getEntity( key.getEntityName(), key.getIdentifier() ); if ( newObject != null ) { lock( newObject, LockMode.NONE ); } return newObject; } else { return result; } }
return getEntity( session.generateEntityKey( key, collectionPersister.getOwnerEntityPersister() ) ); return null; return getEntity( session.generateEntityKey( owenerId, ownerPersister ) ); final Object owner = getEntity( new EntityUniqueKey( ownerPersister.getEntityName(), return getEntity( session.generateEntityKey( ownerId, ownerPersister ) ); return getEntity( session.generateEntityKey( key, collectionPersister.getOwnerEntityPersister() ) );
/** * Get the entity that owns this persistent collection */ @Override public Object getCollectionOwner(Serializable key, CollectionPersister collectionPersister) throws MappingException { return getEntity( session.generateEntityKey( key, collectionPersister.getOwnerEntityPersister() ) ); }
/** * Get the entity that owns this persistent collection */ @Override public Object getCollectionOwner(Serializable key, CollectionPersister collectionPersister) throws MappingException { return getEntity( session.generateEntityKey( key, collectionPersister.getOwnerEntityPersister() ) ); }
@Override public void checkUniqueness(EntityKey key, Object object) throws HibernateException { final Object entity = getEntity( key ); if ( entity == object ) { throw new AssertionFailure( "object already associated, but no entry was found" ); } if ( entity != null ) { throw new NonUniqueObjectException( key.getIdentifier(), key.getEntityName() ); } }
return getEntity( session.generateEntityKey( key, (EntityTypeDescriptor) descriptor.getContainer() ) );
/** * Attempts to check whether the given key represents an entity already loaded within the * current session. * @param object The entity reference against which to perform the uniqueness check. * @throws HibernateException */ @Override public void checkUniqueness(EntityKey key, Object object) throws HibernateException { Object entity = getEntity(key); if ( entity == object ) { throw new AssertionFailure( "object already associated, but no entry was found" ); } if ( entity != null ) { throw new NonUniqueObjectException( key.getIdentifier(), key.getEntityName() ); } }
/** * Attempts to check whether the given key represents an entity already loaded within the * current session. * @param object The entity reference against which to perform the uniqueness check. * @throws HibernateException */ @Override public void checkUniqueness(EntityKey key, Object object) throws HibernateException { Object entity = getEntity(key); if ( entity == object ) { throw new AssertionFailure( "object already associated, but no entry was found" ); } if ( entity != null ) { throw new NonUniqueObjectException( key.getIdentifier(), key.getEntityName() ); } }
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException { errorIfClosed(); // todo : should this get moved to PersistentContext? // logically, is PersistentContext the "thing" to which an interceptor gets attached? final Object result = persistenceContext.getEntity(key); if ( result == null ) { final Object newObject = interceptor.getEntity( key.getEntityName(), key.getIdentifier() ); if ( newObject != null ) { lock( newObject, LockMode.NONE ); } return newObject; } else { return result; } }
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException { errorIfClosed(); // todo : should this get moved to PersistentContext? // logically, is PersistentContext the "thing" to which an interceptor gets attached? final Object result = persistenceContext.getEntity(key); if ( result == null ) { final Object newObject = interceptor.getEntity( key.getEntityName(), key.getIdentifier() ); if ( newObject != null ) { lock( newObject, LockMode.NONE ); } return newObject; } else { return result; } }
@Override public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException { checkOpenOrWaitingForAutoClose(); // todo : should this get moved to PersistentContext? // logically, is PersistentContext the "thing" to which an interceptor gets attached? final Object result = persistenceContext.getEntity( key ); if ( result == null ) { final Object newObject = getInterceptor().getEntity( key.getEntityName(), key.getIdentifier() ); if ( newObject != null ) { lock( newObject, LockMode.NONE ); } return newObject; } else { return result; } }