SessionImplementor getFactory - 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 getFactory method.

This code example shows how to use the following methods:getFactory
	public static SearchFactoryImplementor getSearchFactory(Session session) {
		return getSearchFactoryBySessionImplementor( (SessionImplementor) session );
	} 
 
	public static SearchFactoryImplementor getSearchFactoryBySessionImplementor(SessionImplementor session) {
		return getSearchFactoryBySFI( session.getFactory() );
	} 
 
	public static SearchFactoryImplementor getSearchFactoryBySFI(SessionFactoryImplementor sfi) {
		final SearchFactoryReference factoryReference = sfi.getServiceRegistry()
			.getService( SearchFactoryReference.class );
		if ( factoryReference != null ) {
			return factoryReference.getSearchFactory();
		} 
		else { 
			throw LoggerFactory.make().searchFactoryReferenceServiceNotFound();
		} 
	} 
} 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getFactory
	public int bind(PreparedStatement statement, QueryParameters qp, SessionImplementor session, int position)
	        throws SQLException {
		TypedValue typedValue = ( TypedValue ) qp.getNamedParameters().get( name );
		typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session );
		return typedValue.getType().getColumnSpan( session.getFactory() );
	} 
 
	/** 
	 * {@inheritDoc} 
	 */ 
	public String renderDisplayInfo() {
		return "name=" + name + ", expectedType=" + getExpectedType();
	} 
 
	/** 
	 * Getter for property 'name'. 
	 * 
	 * @return Value for property 'name'. 
	 */ 
	public String getName() {
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getFactory
		 
		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 ); 
			if (id==null) { 
				throw new AssertionFailure( 
						"cannot cache a reference to an object with a null id: " +  
						getAssociatedEntityName()  
				); 
			} 
			return getIdentifierType(session).disassemble(id, session, owner); 
		} 
	} 
 
	public Object assemble(Serializable oid, SessionImplementor session, Object owner) 
	throws HibernateException { 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getContextEntityIdentifier, getEntityPersister, getFactory, getInterceptor, getPersistenceContext
 
	/** 
	 * {@inheritDoc} 
	 */ 
	public Serializable generate(SessionImplementor sessionImplementor, Object object) {
		Session session = ( Session ) sessionImplementor;
 
		final EntityPersister persister = sessionImplementor.getFactory().getEntityPersister( entityName );
		Object associatedObject = persister.getPropertyValue( object, propertyName );
		if ( associatedObject == null ) { 
			throw new IdentifierGenerationException(
					"attempted to assign id from null one-to-one property [" + getRole() + "]"
			); 
		} 
 
		final EntityType foreignValueSourceType;
		final Type propertyType = persister.getPropertyType( propertyName );
		if ( propertyType.isEntityType() ) {
			// the normal case 
			foreignValueSourceType = (EntityType) propertyType;

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getFactory
			Object owner, 
			Map copyCache) throws HibernateException { 
		if ( isEqual( original, target ) ) { 
			return original; 
		} 
		return deepCopy( original, session.getFactory() ); 
	} 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getFactory
			boolean[] checkable, 
			SessionImplementor session) throws HibernateException { 
		if ( isAlwaysDirtyChecked() ) { 
			return isDirty( old, current, session ); 
		} 
		else { 
			if ( isSame( old, current ) ) { 
				return false; 
			} 
			Object oldid = getIdentifier( old, session ); 
			Object newid = getIdentifier( current, session ); 
			return getIdentifierType( session ).isDirty( oldid, newid, checkable, session ); 
		} 
		 
	} 
 
} 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getFactory
		try { 
			getResultSet().afterLast();
		} 
		catch (SQLException sqle) {
			throw getSession().getFactory().getSQLExceptionHelper().convert(
					sqle,
					"exception calling afterLast()" 
				); 
		} 
	} 
 
	/** 
	 * @see org.hibernate.ScrollableResults#beforeFirst() 
	 */ 
	public void beforeFirst() throws HibernateException {
		try { 
			getResultSet().beforeFirst();
		} 
		catch (SQLException sqle) {
			throw getSession().getFactory().getSQLExceptionHelper().convert(
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getContextEntityIdentifier, getFactory, getPersistenceContext, internalLoad

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEntityPersister, getFactory, getInterceptor, getPersistenceContext
			// if it was a reference to self, don't need to nullify 
			// unless we are using native id generation, in which 
			// case we definitely need to nullify 
			if ( object == self ) { 
				return isEarlyInsert || (
					isDelete &&
					session.getFactory()
						.getDialect()
						.hasSelfReferentialForeignKeyBug()
				); 
			} 
	 
			// See if the entity is already bound to this session, if not look at the 
			// entity identifier and assume that the entity is persistent if the 
			// id is not "unsaved" (that is, we rely on foreign keys to keep 
			// database integrity) 
	 
			EntityEntry entityEntry = session.getPersistenceContext().getEntry(object);
			if ( entityEntry==null ) {
				return isTransient(entityName, object, null, session);

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
getFactory Method Overview
Get the creating SessionFactoryImplementor
See Code Examples for other Hibernate ORM SessionImplementor Methods: