SessionImplementor isOpen - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SessionImplementor isOpen method.

This code example shows how to use the following methods:generateEntityKey, getFactory, getPersistenceContext, isClosed, isOpen
		return readOnly;
	} 
 
	@Override 
	public final void setReadOnly(boolean readOnly) {
		errorIfReadOnlySettingNotAvailable(); 
		// only update if readOnly is different from current setting 
		if ( this.readOnly != readOnly ) {
			final EntityPersister persister = session.getFactory().getEntityPersister( entityName );
			if ( ! persister.isMutable() && ! readOnly ) {
				throw new IllegalStateException( "cannot make proxies for immutable entities modifiable");
			} 
			this.readOnly = readOnly;
			if ( initialized ) {
				EntityKey key = generateEntityKeyOrNull( getIdentifier(), session, getEntityName() );
				if ( key != null && session.getPersistenceContext().containsEntity( key ) ) {
					session.getPersistenceContext().setReadOnly( target, readOnly );
				} 
			} 
		} 

6
CodeRank
This code example shows how to use the following methods:generateEntityKey, getFactory, getPersistenceContext, isOpen
 
	} 
 
	private Object getReplacement() { 
		final SessionImplementor session = getSession();
		if ( isUninitialized() && session != null && session.isOpen()) {
			final EntityKey key = session.generateEntityKey(
					getIdentifier(),
					session.getFactory().getEntityPersister( getEntityName() )
			); 
			final Object entity = session.getPersistenceContext().getEntity(key);
			if (entity!=null) setImplementation( entity );
		} 
 
		if ( isUninitialized() ) {
			if (replacement==null) { 
				replacement = serializableProxy(); 
			} 
			return replacement; 
		} 
6
CodeRank
This code example shows how to use the following methods:immediateLoad, isConnected, isOpen
isOpen Method Overview
See Code Examples for other Hibernate ORM SessionImplementor Methods: