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();
		} 
	} 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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. 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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() {
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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");
		} 
	} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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 { 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Hibernate ORM SessionImplementor Methods: