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

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
This code example shows how to use the following methods:getContextEntityIdentifier, getEntityPersister, getFactory, getInterceptor, getPersistenceContext
			String[] names, 
			SessionImplementor session, 
			Object owner) throws HibernateException, SQLException { 
		return resolve( hydrate(rs, names, session, owner), session, owner ); 
	} 
 
	/** 
	 * Two entities are considered the same when their instances are the same. 
	 * 
	 * 
	 * @param x One entity instance 
	 * @param y Another entity instance 
	 * @return True if x == y; false otherwise. 
	 */ 
	public final boolean isSame(Object x, Object y) { 
		return x == y; 
	} 
 
	/** 
	 * {@inheritDoc} 

6
CodeRank
This code example shows how to use the following methods:getContextEntityIdentifier, getEntityPersister, getFactory, getInterceptor, getPersistenceContext
			SessionImplementor session, 
			Object owner) throws HibernateException { 
		 
		//TODO: currently broken for unique-key references (does not detect 
		//      change to unique key property of the associated object) 
		 
		Serializable id = assembleId( oid, session ); 
 
		if ( isNotEmbedded( session ) ) { 
			return id; 
		} 
		 
		if ( id == null ) { 
			return null; 
		} 
		else { 
			return resolveIdentifier( id, session ); 
		} 
	} 
 

5
CodeRank
This code example shows how to use the following methods:getContextEntityIdentifier, getEntityPersister, getFactory, getInterceptor, getPersistenceContext
						"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 { 
		//TODO: currently broken for unique-key references (does not detect 
		//      change to unique key property of the associated object) 
		Serializable id = (Serializable) getIdentifierType(session).assemble(oid, session, null); //the owner of the association is not the owner of the id 
 
		if ( isNotEmbedded(session) ) return id; 
		 
		if (id==null) { 
			return null; 
		} 
		else { 

4
CodeRank
guessEntityName Method Overview
The guessed entity name for an entity not in an association
See Code Examples for other Hibernate ORM SessionImplementor Methods: