/** * Is this collection in a state that would allow us to * "queue" clear? This is a special case, because of orphan * delete. */ @SuppressWarnings({"JavaDoc"}) protected boolean isClearQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollectionNoOrphanDelete(); }
/** * Is this collection in a state that would allow us to * "queue" operations? */ @SuppressWarnings({"JavaDoc"}) protected boolean isOperationQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollection(); }
/** * Is this collection in a state that would allow us to * "queue" puts? This is a special case, because of orphan * delete. */ @SuppressWarnings({"JavaDoc"}) protected boolean isPutQueueEnabled() { return !initialized && isConnectedToSession() && isInverseOneToManyOrNoOrphanDelete(); }
private void throwLazyInitializationExceptionIfNotConnected() { if ( !isConnectedToSession() ) { throwLazyInitializationException( "no session or session was closed" ); } if ( !session.isConnected() ) { throwLazyInitializationException( "session is disconnected" ); } }
@Override public final boolean setCurrentSession(SharedSessionContractImplementor session) throws HibernateException { if ( session == this.session ) { return false; } else if ( this.session != null ) { final String msg = generateUnexpectedSessionStateMessage( session ); if ( isConnectedToSession() ) { throw new HibernateException( "Illegal attempt to associate a collection with two open sessions. " + msg ); } else { LOG.logUnexpectedSessionInCollectionNotConnected( msg ); } } if ( hasQueuedOperations() ) { LOG.queuedOperationWhenAttachToSession( MessageHelper.collectionInfoString( getRole(), getKey() ) ); } this.session = session; return true; }
/** * Is this collection in a state that would allow us to * "queue" operations? */ @SuppressWarnings( {"JavaDoc"}) protected boolean isOperationQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollection(); } /**
/** * Is this collection in a state that would allow us to * "queue" clear? This is a special case, because of orphan * delete. */ @SuppressWarnings( {"JavaDoc"}) protected boolean isClearQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollectionNoOrphanDelete(); }
/** * Is this collection in a state that would allow us to * "queue" operations? */ @SuppressWarnings({"JavaDoc"}) protected boolean isOperationQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollection(); }
/** * Is this collection in a state that would allow us to * "queue" puts? This is a special case, because of orphan * delete. */ @SuppressWarnings({"JavaDoc"}) protected boolean isPutQueueEnabled() { return !initialized && isConnectedToSession() && isInverseOneToManyOrNoOrphanDelete(); }
/** * Is this collection in a state that would allow us to * "queue" clear? This is a special case, because of orphan * delete. */ @SuppressWarnings({"JavaDoc"}) protected boolean isClearQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollectionNoOrphanDelete(); }
/** * Is this collection in a state that would allow us to * "queue" puts? This is a special case, because of orphan * delete. */ @SuppressWarnings( {"JavaDoc"}) protected boolean isPutQueueEnabled() { return !initialized && isConnectedToSession() && isInverseOneToManyOrNoOrphanDelete(); } /**
/** * Is this collection in a state that would allow us to * "queue" puts? This is a special case, because of orphan * delete. */ @SuppressWarnings( {"JavaDoc"}) protected boolean isPutQueueEnabled() { return !initialized && isConnectedToSession() && isInverseOneToManyOrNoOrphanDelete(); } /**
/** * Is this collection in a state that would allow us to * "queue" operations? */ @SuppressWarnings( {"JavaDoc"}) protected boolean isOperationQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollection(); } /**
/** * Is this collection in a state that would allow us to * "queue" clear? This is a special case, because of orphan * delete. */ @SuppressWarnings( {"JavaDoc"}) protected boolean isClearQueueEnabled() { return !initialized && isConnectedToSession() && isInverseCollectionNoOrphanDelete(); }
private void throwLazyInitializationExceptionIfNotConnected() { if ( !isConnectedToSession() ) { throwLazyInitializationException( "no session or session was closed" ); } if ( !session.isConnected() ) { throwLazyInitializationException( "session is disconnected" ); } }
private void throwLazyInitializationExceptionIfNotConnected() { if ( !isConnectedToSession() ) { throwLazyInitializationException("no session or session was closed"); } if ( !session.isConnected() ) { throwLazyInitializationException("session is disconnected"); } }
private void throwLazyInitializationExceptionIfNotConnected() { if ( !isConnectedToSession() ) { throwLazyInitializationException("no session or session was closed"); } if ( !session.isConnected() ) { throwLazyInitializationException("session is disconnected"); } }
if ( isConnectedToSession() ) { CollectionEntry ce = session.getPersistenceContext().getCollectionEntry(this); if (ce==null) {
if ( isConnectedToSession() ) { CollectionEntry ce = session.getPersistenceContext().getCollectionEntry(this); if (ce==null) {
@Override public final boolean setCurrentSession(SharedSessionContractImplementor session) throws HibernateException { if ( session == this.session ) { assert collectionDescriptor != null; return false; } else if ( this.session != null ) { assert collectionDescriptor != null; final String msg = generateUnexpectedSessionStateMessage( session ); if ( isConnectedToSession() ) { throw new HibernateException( "Illegal attempt to associate a collection with two open sessions. " + msg ); } else { LOG.logUnexpectedSessionInCollectionNotConnected( msg ); this.collectionDescriptor = session.getFactory().getMetamodel().findCollectionDescriptor( getRole() ); } } if ( hasQueuedOperations() ) { LOG.queuedOperationWhenAttachToSession( MessageHelper.collectionInfoString( getRole(), getKey() ) ); } this.session = session; return true; }