org.hibernate.persister.entity.PropertyMapping Java Examples

The following examples show how to use org.hibernate.persister.entity.PropertyMapping. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntityQuerySpaceImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ExpandingCompositeQuerySpace makeCompositeIdentifierQuerySpace() {
	final String compositeQuerySpaceUid = getUid() + "-id";
	final ExpandingCompositeQuerySpace rhs = getExpandingQuerySpaces().makeCompositeQuerySpace(
			compositeQuerySpaceUid,
			new CompositePropertyMapping(
					(CompositeType) getEntityPersister().getIdentifierType(),
					(PropertyMapping) getEntityPersister(),
					getEntityPersister().getIdentifierPropertyName()
			),
			canJoinsBeRequired()
	);
	final JoinDefinedByMetadata join = JoinHelper.INSTANCE.createCompositeJoin(
			this,
			EntityPersister.ENTITY_ID,
			rhs,
			canJoinsBeRequired(),
			(CompositeType) persister.getIdentifierType()
	);
	internalGetJoins().add( join );

	return rhs;
}
 
Example #2
Source File: AbstractEmptinessExpression.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
protected QueryableCollection getQueryableCollection(String entityName, String propertyName, SessionFactoryImplementor factory)
        throws HibernateException {
	PropertyMapping ownerMapping = ( PropertyMapping ) factory.getEntityPersister( entityName );
	Type type = ownerMapping.toType( propertyName );
	if ( !type.isCollectionType() ) {
		throw new MappingException(
		        "Property path [" + entityName + "." + propertyName + "] does not reference a collection"
		);
	}

	String role = ( ( CollectionType ) type ).getRole();
	try {
		return ( QueryableCollection ) factory.getCollectionPersister( role );
	}
	catch ( ClassCastException cce ) {
		throw new QueryException( "collection role is not queryable: " + role );
	}
	catch ( Exception e ) {
		throw new QueryException( "collection role not found: " + role );
	}
}
 
Example #3
Source File: JoinHelper.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the qualified (prefixed by alias) names of the columns of the owning entity which are to be used in the join
 *
 * @param associationType The association type for the association that represents the join
 * @param columnQualifier The left-hand side table alias
 * @param propertyIndex The index of the property that represents the association/join
 * @param begin The index for any nested (composites) attributes
 * @param lhsPersister The persister for the left-hand side of the association/join
 * @param mapping The mapping (typically the SessionFactory).
 *
 * @return The qualified column names.
 */
public static String[] getAliasedLHSColumnNames(
		AssociationType associationType,
		String columnQualifier,
		int propertyIndex,
		int begin,
		OuterJoinLoadable lhsPersister,
		Mapping mapping) {
	if ( associationType.useLHSPrimaryKey() ) {
		return StringHelper.qualify( columnQualifier, lhsPersister.getIdentifierColumnNames() );
	}
	else {
		final String propertyName = associationType.getLHSPropertyName();
		if ( propertyName == null ) {
			return ArrayHelper.slice(
					toColumns( lhsPersister, columnQualifier, propertyIndex ),
					begin,
					associationType.getColumnSpan( mapping )
			);
		}
		else {
			//bad cast
			return ( (PropertyMapping) lhsPersister ).toColumns( columnQualifier, propertyName );
		}
	}
}
 
Example #4
Source File: JoinHelper.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Get the aliased columns of the owning entity which are to 
 * be used in the join
 */
public static String[] getAliasedLHSColumnNames(
		AssociationType type, 
		String alias, 
		int property, 
		int begin, 
		OuterJoinLoadable lhsPersister,
		Mapping mapping
) {
	if ( type.useLHSPrimaryKey() ) {
		return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() );
	}
	else {
		String propertyName = type.getLHSPropertyName();
		if (propertyName==null) {
			return ArrayHelper.slice( 
					lhsPersister.toColumns(alias, property), 
					begin, 
					type.getColumnSpan(mapping) 
				);
		}
		else {
			return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast
		}
	}
}
 
Example #5
Source File: FromElementType.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Returns the type of a property, given it's name (the last part) and the full path.
 *
 * @param propertyName The last part of the full path to the property.
 * @return The type.
 * @0param propertyPath The full property path.
 */
public Type getPropertyType(String propertyName, String propertyPath) {
	checkInitialized();
	Type type = null;
	// If this is an entity and the property is the identifier property, then use getIdentifierType().
	//      Note that the propertyName.equals( propertyPath ) checks whether we have a component
	//      key reference, where the component class property name is the same as the
	//      entity id property name; if the two are not equal, this is the case and
	//      we'd need to "fall through" to using the property mapping.
	if ( persister != null && propertyName.equals( propertyPath ) && propertyName.equals( persister.getIdentifierPropertyName() ) ) {
		type = persister.getIdentifierType();
	}
	else {	// Otherwise, use the property mapping.
		PropertyMapping mapping = getPropertyMapping( propertyName );
		type = mapping.toType( propertyPath );
	}
	if ( type == null ) {
		throw new MappingException( "Property " + propertyName + " does not exist in " +
				( ( queryableCollection == null ) ? "class" : "collection" ) + " "
				+ ( ( queryableCollection == null ) ? fromElement.getClassName() : queryableCollection.getRole() ) );
	}
	return type;
}
 
Example #6
Source File: FromElementType.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
PropertyMapping getPropertyMapping(String propertyName) {
	checkInitialized();
	if ( queryableCollection == null ) {		// Not a collection?
		return ( PropertyMapping ) persister;	// Return the entity property mapping.
	}
	// If the property is a special collection property name, return a CollectionPropertyMapping.
	if ( CollectionProperties.isCollectionProperty( propertyName ) ) {
		if ( collectionPropertyMapping == null ) {
			collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection );
		}
		return collectionPropertyMapping;
	}
	if ( queryableCollection.getElementType().isAnyType() ) {
		// collection of <many-to-any/> mappings...
		// used to circumvent the component-collection check below...
		return queryableCollection;

	}
	if ( queryableCollection.getElementType().isComponentType() ) {
		// Collection of components.
		if ( propertyName.equals( EntityPersister.ENTITY_ID ) ) {
			return ( PropertyMapping ) queryableCollection.getOwnerEntityPersister();
		}
	}
	return queryableCollection;
}
 
Example #7
Source File: AbstractEmptinessExpression.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
protected QueryableCollection getQueryableCollection(
		String entityName,
		String propertyName,
		SessionFactoryImplementor factory) throws HibernateException {
	final PropertyMapping ownerMapping = (PropertyMapping) factory.getEntityPersister( entityName );
	final Type type = ownerMapping.toType( propertyName );
	if ( !type.isCollectionType() ) {
		throw new MappingException(
				"Property path [" + entityName + "." + propertyName + "] does not reference a collection"
		);
	}

	final String role = ( (CollectionType) type ).getRole();
	try {
		return (QueryableCollection) factory.getCollectionPersister( role );
	}
	catch ( ClassCastException cce ) {
		throw new QueryException( "collection role is not queryable: " + role );
	}
	catch ( Exception e ) {
		throw new QueryException( "collection role not found: " + role );
	}
}
 
Example #8
Source File: QueryTranslatorImpl.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
PropertyMapping getPropertyMapping(String name) throws QueryException {
	PropertyMapping decorator = getDecoratedPropertyMapping( name );
	if ( decorator != null ) return decorator;

	String type = getType( name );
	if ( type == null ) {
		String role = getRole( name );
		if ( role == null ) {
			throw new QueryException( "alias not found: " + name );
		}
		return getCollectionPersister( role ); //.getElementPropertyMapping();
	}
	else {
		Queryable persister = getEntityPersister( type );
		if ( persister == null ) throw new QueryException( "persistent class not found: " + type );
		return persister;
	}
}
 
Example #9
Source File: QueryTranslatorImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
PropertyMapping getPropertyMapping(String name) throws QueryException {
	PropertyMapping decorator = getDecoratedPropertyMapping( name );
	if ( decorator != null ) {
		return decorator;
	}

	String type = getType( name );
	if ( type == null ) {
		String role = getRole( name );
		if ( role == null ) {
			throw new QueryException( "alias not found: " + name );
		}
		return getCollectionPersister( role ); //.getElementPropertyMapping();
	}
	else {
		Queryable persister = getEntityPersister( type );
		if ( persister == null ) {
			throw new QueryException( "persistent class not found: " + type );
		}
		return persister;
	}
}
 
Example #10
Source File: CompositePropertyMapping.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Builds a CompositePropertyMapping
 *
 * @param compositeType The composite being described by this PropertyMapping
 * @param parentPropertyMapping The PropertyMapping of our parent (composites have to have a parent/owner)
 * @param parentPropertyName The name of this composite within the parentPropertyMapping
 */
public CompositePropertyMapping(
		CompositeType compositeType,
		PropertyMapping parentPropertyMapping,
		String parentPropertyName) {
	this.compositeType = compositeType;
	this.parentPropertyMapping = parentPropertyMapping;
	this.parentPropertyName = parentPropertyName;
}
 
Example #11
Source File: EntityQuerySpaceImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PropertyMapping getPropertyMapping() {
	// entity persisters are typically PropertyMapping implementors, but this is part of the funky
	// "optional interface hierarchy" for entity persisters.  The internal ones all implement
	// PropertyMapping...
	return (PropertyMapping) persister;
}
 
Example #12
Source File: CriteriaQueryTranslator.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private PropertyMapping getPropertyMapping(String entityName) throws MappingException {
	final CriteriaInfoProvider info = nameCriteriaInfoMap.get( entityName );
	if ( info == null ) {
		throw new HibernateException( "Unknown entity: " + entityName );
	}
	return info.getPropertyMapping();
}
 
Example #13
Source File: FromElementType.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the type of a property, given it's name (the last part) and the full path.
 *
 * @param propertyName The last part of the full path to the property.
 *
 * @return The type.
 *
 * @0param getPropertyPath The full property path.
 */
public Type getPropertyType(String propertyName, String propertyPath) {
	checkInitialized();
	Type type = null;
	// If this is an entity and the property is the identifier property, then use getIdentifierType().
	//      Note that the propertyName.equals( getPropertyPath ) checks whether we have a component
	//      key reference, where the component class property name is the same as the
	//      entity id property name; if the two are not equal, this is the case and
	//      we'd need to "fall through" to using the property mapping.
	if ( persister != null && propertyName.equals( propertyPath ) && propertyName.equals( persister.getIdentifierPropertyName() ) ) {
		type = persister.getIdentifierType();
	}
	else {    // Otherwise, use the property mapping.
		PropertyMapping mapping = getPropertyMapping( propertyName );
		type = mapping.toType( propertyPath );
	}
	if ( type == null ) {
		throw new MappingException(
				"Property " + propertyName + " does not exist in " +
						( ( queryableCollection == null ) ? "class" : "collection" ) + " "
						+ ( ( queryableCollection == null ) ?
						fromElement.getClassName() :
						queryableCollection.getRole() )
		);
	}
	return type;
}
 
Example #14
Source File: SubselectFetch.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public String toSubselectString(String ukname) {
	
	String[] joinColumns = ukname==null ?
		StringHelper.qualify( alias, loadable.getIdentifierColumnNames() ) :
		( (PropertyMapping) loadable ).toColumns(alias, ukname);
	
	return new StringBuffer()
		.append("select ")
		.append( StringHelper.join(", ", joinColumns) )
		.append(queryString)
		.toString();
}
 
Example #15
Source File: SubselectFetch.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public String toSubselectString(String ukname) {
	String[] joinColumns = ukname == null
			? StringHelper.qualify( alias, loadable.getIdentifierColumnNames() )
			: ( (PropertyMapping) loadable ).toColumns( alias, ukname );

	return "select " + String.join( ", ", joinColumns ) + queryString;
}
 
Example #16
Source File: FromElement.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public PropertyMapping getPropertyMapping(String propertyName) {
	return elementType.getPropertyMapping( propertyName );
}
 
Example #17
Source File: QueryTranslatorImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
void decoratePropertyMapping(String name, PropertyMapping mapping) {
	decoratedPropertyMappings.put( name, mapping );
}
 
Example #18
Source File: QueryTranslatorImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private PropertyMapping getDecoratedPropertyMapping(String name) {
	return (PropertyMapping) decoratedPropertyMappings.get( name );
}
 
Example #19
Source File: HibernateQuery.java    From gorm-hibernate5 with Apache License 2.0 4 votes vote down vote up
protected PropertyMapping getEntityPersister(String name, SessionFactory sessionFactory) {
    return (PropertyMapping) ((SessionFactoryImplementor) sessionFactory).getEntityPersister(name);
}
 
Example #20
Source File: CriteriaQueryTranslator.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
private PropertyMapping getPropertyMapping(String entityName)
		throws MappingException {
	return ( PropertyMapping ) sessionFactory.getEntityPersister( entityName );
}
 
Example #21
Source File: FromElementType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
PropertyMapping getPropertyMapping(String propertyName) {
	checkInitialized();
	if ( queryableCollection == null ) {        // Not a collection?
		return (PropertyMapping) persister;    // Return the entity property mapping.
	}

	// indexed, many-to-many collections must be treated specially here if the property to
	// be mapped touches on the index as we must adjust the alias to use the alias from
	// the association table (which i different than the one passed in
	if ( queryableCollection.isManyToMany()
			&& queryableCollection.hasIndex()
			&& SPECIAL_MANY2MANY_TREATMENT_FUNCTION_NAMES.contains( propertyName ) ) {
		return new SpecialManyToManyCollectionPropertyMapping();
	}

	// If the property is a special collection property name, return a CollectionPropertyMapping.
	if ( CollectionProperties.isCollectionProperty( propertyName ) ) {
		if ( collectionPropertyMapping == null ) {
			// lets additionally make sure that the property name is not also the name
			// of a property on the element, assuming that the element is an entity.
			// todo : also consider composites?
			if ( persister != null ) {
				try {
					if ( persister.getPropertyType( propertyName ) != null ) {
						return (PropertyMapping) persister;
					}
				}
				catch (QueryException ignore) {
				}
			}
			collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection );
		}
		return collectionPropertyMapping;
	}

	if ( queryableCollection.getElementType().isAnyType() ) {
		// collection of <many-to-any/> mappings...
		// used to circumvent the component-collection check below...
		return queryableCollection;

	}

	if ( queryableCollection.getElementType().isComponentType() ) {
		// Collection of components.
		if ( propertyName.equals( EntityPersister.ENTITY_ID ) ) {
			return (PropertyMapping) queryableCollection.getOwnerEntityPersister();
		}
	}
	return queryableCollection;
}
 
Example #22
Source File: FromElementType.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
String[] toColumns(String tableAlias, String path, boolean inSelect, boolean forceAlias) {
	checkInitialized();
	PropertyMapping propertyMapping = getPropertyMapping( path );
	// If this from element is a collection and the path is a collection property (maxIndex, etc.) then
	// generate a sub-query.
	if ( !inSelect && queryableCollection != null && CollectionProperties.isCollectionProperty( path ) ) {
		Map enabledFilters = fromElement.getWalker().getEnabledFilters();
		String subquery = CollectionSubqueryFactory.createCollectionSubquery(
				joinSequence,
		        enabledFilters,
				propertyMapping.toColumns( tableAlias, path )
		);
		if ( log.isDebugEnabled() ) {
			log.debug( "toColumns(" + tableAlias + "," + path + ") : subquery = " + subquery );
		}
		return new String[]{"(" + subquery + ")"};
	}
	else {
		if ( forceAlias ) {
			return propertyMapping.toColumns( tableAlias, path );
		}
		else if ( fromElement.getWalker().getStatementType() == HqlSqlTokenTypes.SELECT ) {
			return propertyMapping.toColumns( tableAlias, path );
		}
		else if ( fromElement.getWalker().getCurrentClauseType() == HqlSqlTokenTypes.SELECT ) {
			return propertyMapping.toColumns( tableAlias, path );
		}
		else if ( fromElement.getWalker().isSubQuery() ) {
			// for a subquery, the alias to use depends on a few things (we
			// already know this is not an overall SELECT):
			//      1) if this FROM_ELEMENT represents a correlation to the
			//          outer-most query
			//              A) if the outer query represents a multi-table
			//                  persister, we need to use the given alias
			//                  in anticipation of one of the multi-table
			//                  executors being used (as this subquery will
			//                  actually be used in the "id select" phase
			//                  of that multi-table executor)
			//              B) otherwise, we need to use the persister's
			//                  table name as the column qualification
			//      2) otherwise (not correlated), use the given alias
			if ( isCorrelation() ) {
				if ( isMultiTable() ) {
					return propertyMapping.toColumns( tableAlias, path );
				}
				else {
					return propertyMapping.toColumns( extractTableName(), path );
				}
			}
			else {
				return propertyMapping.toColumns( tableAlias, path );
			}
		}
		else {
			String[] columns = propertyMapping.toColumns( path );
			log.trace( "Using non-qualified column reference [" + path + " -> (" + ArrayHelper.toString( columns ) + ")]" );
			return columns;
		}
	}
}
 
Example #23
Source File: PathExpressionParser.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
private PropertyMapping getPropertyMapping() {
	return currentPropertyMapping;
}
 
Example #24
Source File: QueryTranslatorImpl.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
private PropertyMapping getDecoratedPropertyMapping(String name) {
	return ( PropertyMapping ) decoratedPropertyMappings.get( name );
}
 
Example #25
Source File: QueryTranslatorImpl.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
void decoratePropertyMapping(String name, PropertyMapping mapping) {
	decoratedPropertyMappings.put( name, mapping );
}
 
Example #26
Source File: PathExpressionParser.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private PropertyMapping getPropertyMapping() {
	return currentPropertyMapping;
}
 
Example #27
Source File: FromElementType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public CollectionPropertyReference getCollectionPropertyReference(final String propertyName) {
	if ( queryableCollection == null ) {
		throw new QueryException( "Not a collection reference" );
	}

	final PropertyMapping collectionPropertyMapping;

	if ( queryableCollection.isManyToMany()
			&& queryableCollection.hasIndex()
			&& SPECIAL_MANY2MANY_TREATMENT_FUNCTION_NAMES.contains( propertyName ) ) {
		collectionPropertyMapping = new SpecialManyToManyCollectionPropertyMapping();
	}
	else if ( CollectionProperties.isCollectionProperty( propertyName ) ) {
		if ( this.collectionPropertyMapping == null ) {
			this.collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection );
		}
		collectionPropertyMapping = this.collectionPropertyMapping;
	}
	else {
		collectionPropertyMapping = queryableCollection;
	}

	return new CollectionPropertyReference() {
		@Override
		public Type getType() {
			return collectionPropertyMapping.toType( propertyName );
		}

		@Override
		public String[] toColumns(final String tableAlias) {
			if ( propertyName.equalsIgnoreCase( "index" ) ) {
				return collectionPropertyMapping.toColumns( tableAlias, propertyName );
			}

			Map enabledFilters = fromElement.getWalker().getEnabledFilters();
			String subquery = CollectionSubqueryFactory.createCollectionSubquery(
					joinSequence.copyForCollectionProperty().setUseThetaStyle( true ),
					enabledFilters,
					collectionPropertyMapping.toColumns( tableAlias, propertyName )
			);
			LOG.debugf( "toColumns(%s,%s) : subquery = %s", tableAlias, propertyName, subquery );
			return new String[] {"(" + subquery + ")"};
		}
	};
}
 
Example #28
Source File: FromElementType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
String[] toColumns(String tableAlias, String path, boolean inSelect, boolean forceAlias) {
		checkInitialized();
		PropertyMapping propertyMapping = getPropertyMapping( path );

		if ( !inSelect && queryableCollection != null && CollectionProperties.isCollectionProperty( path ) ) {
			// If this from element is a collection and the path is a collection property (maxIndex, etc.)
			// requiring a sub-query then generate a sub-query.
			//h
			// Unless we are in the select clause, because some dialects do not support
			// Note however, that some dialects do not  However, in the case of this being a collection property reference being in the select, not generating the subquery
			// will not generally work.  The specific cases I am thinking about are the minIndex, maxIndex
			// (most likely minElement, maxElement as well) cases.
			//	todo : if ^^ is the case we should thrown an exception here rather than waiting for the sql error
			//		if the dialect supports select-clause subqueries we could go ahead and generate the subquery also

			// we also need to account for cases where the property name is a CollectionProperty, but
			// is also a property on the element-entity.  This is handled inside `#getPropertyMapping`
			// already; here just check for propertyMapping being the same as the entity persister.  Yes
			// this is hacky, but really this is difficult to handle given the current codebase.
			if ( persister != propertyMapping ) {
				// we want the subquery...
//				DeprecationLogger.DEPRECATION_LOGGER.logDeprecationOfCollectionPropertiesInHql( path, fromElement.getClassAlias() );
				return getCollectionPropertyReference( path ).toColumns( tableAlias );
			}
		}

		if ( forceAlias ) {
			return propertyMapping.toColumns( tableAlias, path );
		}

		if ( fromElement.getWalker().getStatementType() == HqlSqlTokenTypes.SELECT ) {
			return propertyMapping.toColumns( tableAlias, path );
		}

		if ( fromElement.getWalker().isSubQuery() ) {
			// for a subquery, the alias to use depends on a few things (we
			// already know this is not an overall SELECT):
			// 1) if this FROM_ELEMENT represents a correlation to the
			// outer-most query
			// A) if the outer query represents a multi-table
			// persister, we need to use the given alias
			// in anticipation of one of the multi-table
			// executors being used (as this subquery will
			// actually be used in the "id select" phase
			// of that multi-table executor)
			// B) otherwise, we need to use the persister's
			// table name as the column qualification
			// 2) otherwise (not correlated), use the given alias
			if ( isCorrelation() ) {
				if ( isMultiTable() || isInsertQuery() ) {
					return propertyMapping.toColumns( tableAlias, path );
				}
				return propertyMapping.toColumns( extractTableName(), path );
			}
			return propertyMapping.toColumns( tableAlias, path );
		}

		if ( fromElement.getWalker().getCurrentTopLevelClauseType() == HqlSqlTokenTypes.SELECT ) {
			return propertyMapping.toColumns( tableAlias, path );
		}

		if ( isManipulationQuery() && isMultiTable() && inWhereClause() ) {
			// the actual where-clause will end up being ripped out the update/delete and used in
			// a select to populate the temp table, so its ok to use the table alias to qualify the table refs
			// and safer to do so to protect from same-named columns
			return propertyMapping.toColumns( tableAlias, path );
		}

		String[] columns = propertyMapping.toColumns( path );
		LOG.tracev( "Using non-qualified column reference [{0} -> ({1})]", path, ArrayHelper.toString( columns ) );
		return columns;
	}
 
Example #29
Source File: ScalarCollectionCriteriaInfoProvider.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public PropertyMapping getPropertyMapping() {
	return helper.getCollectionPropertyMapping( role );
}
 
Example #30
Source File: FromElement.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public PropertyMapping getPropertyMapping(String propertyName) {
	return elementType.getPropertyMapping( propertyName );
}