SessionImplementor generateEntityKey - 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 generateEntityKey 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
 
	public Serializable disassemble( 
			Object value, 
			SessionImplementor session, 
			Object owner) throws HibernateException { 
 
		if ( isNotEmbedded( session ) ) { 
			return getIdentifierType( session ).disassemble( value, session, owner ); 
		} 
		 
		if ( value == null ) { 
			return null; 
		} 
		else { 
			// cache the actual id of the object, not the value of the 
			// property-ref, which might not be initialized 
			Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( 
					getAssociatedEntityName(), 
					value, 
					session 

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:generateEntityKey, getContextEntityIdentifier, getFactory, getPersistenceContext
		return ArrayHelper.EMPTY_BOOLEAN_ARRAY; 
	} 
 
	public void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) { 
		//nothing to do 
	} 
 
	public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) { 
		//nothing to do 
	} 
 
	public boolean isOneToOne() { 
		return true; 
	} 
 
	public boolean isDirty(Object old, Object current, SessionImplementor session) { 
		return false; 
	} 
 
	public boolean isDirty(Object old, Object current, boolean[] checkable, SessionImplementor session) { 
6
CodeRank
This code example shows how to use the following methods:generateEntityKey, getFactory, getPersistenceContext
		else { 
			processDereferencedCollection(coll, session); 
		} 
	} 
 
	private static void processDereferencedCollection(PersistentCollection coll, SessionImplementor session) { 
		final PersistenceContext persistenceContext = session.getPersistenceContext(); 
		CollectionEntry entry = persistenceContext.getCollectionEntry(coll); 
		final CollectionPersister loadedPersister = entry.getLoadedPersister(); 
 
        if (LOG.isDebugEnabled() && loadedPersister != null) { 
			LOG.debugf( 
					"Collection dereferenced: %s", 
					MessageHelper.collectionInfoString( 
							loadedPersister, 
							entry.getLoadedKey(), 
							session.getFactory() 
					) 
			); 
		} 

6
CodeRank
This code example shows how to use the following methods:generateEntityKey, getFactory, getPersistenceContext
		// IMPL NOTE: non-flushed changes code calls this method with session == null... 
		// guard against NullPointerException 
		if ( session != null ) {
			this.session = session;
			this.persister = session.getFactory().getEntityPersister( entityName );
			this.instance = session.getPersistenceContext().getEntity( session.generateEntityKey( id, persister ) );
		} 
	} 
 
	protected <T> EventListenerGroup<T> listenerGroup(EventType<T> eventType) {
		return getSession()
				.getFactory()
				.getServiceRegistry()
				.getService( EventListenerRegistry.class )
				.getEventListenerGroup( eventType );
	} 
 
	protected EventSource eventSource() {
		return (EventSource) getSession();
	} 
5
CodeRank
This code example shows how to use the following methods:generateEntityKey, getEntityPersister, getFactory, getPersistenceContext, forceFlush

7
CodeRank
This code example shows how to use the following methods:generateEntityKey, getEntityPersister, getFactory, getPersistenceContext, forceFlush

7
CodeRank
This code example shows how to use the following methods:generateEntityKey, getEntityPersister, getFactory, getPersistenceContext, forceFlush

7
CodeRank
This code example shows how to use the following methods:generateEntityKey, getEntityPersister, getFactory, getPersistenceContext, forceFlush
	} 
 
	@Override 
	protected CascadingAction getCascadeAction() { 
		return EJB3CascadingAction.PERSIST_SKIPLAZY; 
	} 
} 

7
CodeRank
generateEntityKey Method Overview
Hide the changing requirements of entity key creation
See Code Examples for other Hibernate ORM SessionImplementor Methods: