FileDocCategorySizeDatePackage
CollectionSubqueryFactory.javaAPI DocHibernate 3.2.51230Thu Jan 12 20:10:58 GMT 2006org.hibernate.hql

CollectionSubqueryFactory

public final class CollectionSubqueryFactory extends Object
Provides the SQL for collection subqueries.
Moved here from PathExpressionParser to make it re-useable.
author
josh

Fields Summary
Constructors Summary
private CollectionSubqueryFactory()

	
Methods Summary
public static java.lang.StringcreateCollectionSubquery(org.hibernate.engine.JoinSequence joinSequence, java.util.Map enabledFilters, java.lang.String[] columns)

		try {
			JoinFragment join = joinSequence.toJoinFragment( enabledFilters, true );
			return new StringBuffer( "select " )
					.append( StringHelper.join( ", ", columns ) )
					.append( " from " )
					.append( join.toFromFragmentString().substring( 2 ) )// remove initial ", "
					.append( " where " )
					.append( join.toWhereFragmentString().substring( 5 ) )// remove initial " and "
					.toString();
		}
		catch ( MappingException me ) {
			throw new QueryException( me );
		}