Hibernate ORM SessionImplementor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM SessionImplementor class.

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:getPersistenceContext
	/** 
	 * {@inheritDoc} 
	 */ 
	public void lock( 
			Serializable id,
			Object version, 
			Object object, 
			int timeout,
			SessionImplementor session) throws StaleObjectStateException, JDBCException {
		if ( !lockable.isVersioned() ) {
			throw new HibernateException( "[" + lockMode + "] not supported for non-versioned entities [" + lockable.getEntityName() + "]" );
		} 
		EntityEntry entry = session.getPersistenceContext().getEntry( object );
		final EntityPersister persister = entry.getPersister();
		Object nextVersion = persister.forceVersionIncrement( entry.getId(), entry.getVersion(), session );
		entry.forceLocked( object, nextVersion );
	} 
 
	/** 
	 * Retrieve the specific lock mode defined. 
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:getEntityPersister
	private String entityName;
 
	public Serializable generate(SessionImplementor session, Object obj) throws HibernateException {
		//TODO: cache the persister, this shows up in yourkit 
		final Serializable id = session.getEntityPersister( entityName, obj ).getIdentifier( obj, session );
		if ( id == null ) {
			throw new IdentifierGenerationException(
					"ids for this class must be manually assigned before calling save(): " + entityName
			); 
		} 
		 
		return id;
	} 
 
	public void configure(Type type, Properties params, Dialect d) throws MappingException {
		entityName = params.getProperty(ENTITY_NAME);
		if ( entityName == null ) {
			throw new MappingException("no entity name");
		} 
	} 
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:getPersistenceContext

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:getContextEntityIdentifier
		return false;  
	} 
	 
} 
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPersistenceContext

8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Hibernate ORM SessionImplementor Methods: