@Override public Serializable[] getSpaces() { return persister.getCollectionSpaces(); }
@Override public Serializable[] getSpaces() { return persister.getCollectionSpaces(); }
private void doPathExpression(String token, QueryTranslatorImpl q) throws QueryException { preprocess( token, q ); StringTokenizer tokens = new StringTokenizer( token, ".", true ); pathExpressionParser.start( q ); while ( tokens.hasMoreTokens() ) { pathExpressionParser.token( tokens.nextToken(), q ); } pathExpressionParser.end( q ); if ( pathExpressionParser.isCollectionValued() ) { openExpression( q, "" ); appendToken( q, pathExpressionParser.getCollectionSubquery( q.getEnabledFilters() ) ); closeExpression( q, "" ); // this is ugly here, but needed because its a subquery q.addQuerySpaces( q.getCollectionPersister( pathExpressionParser.getCollectionRole() ).getCollectionSpaces() ); } else { if ( pathExpressionParser.isExpectingCollectionIndex() ) { expectingIndex++; } else { addJoin( pathExpressionParser.getWhereJoin(), q ); appendToken( q, pathExpressionParser.getWhereColumn() ); } } }
roleAlias, entityPersister, (EntityType) queryableCollection.getElementType(), joinType ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() );
FromElement elem = factory.createCollection(queryableCollection, role, joinType, fetch, true); setFromElement(elem); getWalker().addQuerySpaces(queryableCollection.getCollectionSpaces()); // Always add the collection's query spaces.
private FromElement createCollectionJoin(JoinSequence collectionJoinSequence, String tableAlias) throws SemanticException { String text = queryableCollection.getTableName(); AST ast = createFromElement( text ); FromElement destination = (FromElement) ast; Type elementType = queryableCollection.getElementType(); if ( elementType.isCollectionType() ) { throw new SemanticException( "Collections of collections are not supported!" ); } destination.initializeCollection( fromClause, classAlias, tableAlias ); destination.setType( JOIN_FRAGMENT ); // Tag this node as a JOIN. destination.setIncludeSubclasses( false ); // Don't include subclasses in the join. destination.setCollectionJoin( true ); // This is a clollection join. destination.setJoinSequence( collectionJoinSequence ); destination.setOrigin( origin, false ); destination.setCollectionTableAlias( tableAlias ); // origin.addDestination( destination ); // This was the cause of HHH-242 // origin.setType( FROM_FRAGMENT ); // Set the parent node type so that the AST is properly formed. origin.setText( "" ); // The destination node will have all the FROM text. origin.setCollectionJoin( true ); // The parent node is a collection join too (voodoo - see JoinProcessor) fromClause.addCollectionJoinFromElementByPath( path, destination ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); return destination; }
getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); // Always add the collection's query spaces.
public Serializable[] getSpaces() { return persister.getCollectionSpaces(); }
public Serializable[] getSpaces() { return persister.getCollectionSpaces(); }
public Serializable[] getSpaces() { return persister.getCollectionSpaces(); }
public Serializable[] getSpaces() { return persister.getCollectionSpaces(); }
private FromElement createEntityAssociation( String role, String roleAlias, int joinType) throws SemanticException { FromElement elem; Queryable entityPersister = ( Queryable ) queryableCollection.getElementPersister(); String associatedEntityName = entityPersister.getEntityName(); // Get the class name of the associated entity. if ( queryableCollection.isOneToMany() ) { if ( log.isDebugEnabled() ) { log.debug( "createEntityAssociation() : One to many - path = " + path + " role = " + role + " associatedEntityName = " + associatedEntityName ); } JoinSequence joinSequence = createJoinSequence( roleAlias, joinType ); elem = createJoin( associatedEntityName, roleAlias, joinSequence, ( EntityType ) queryableCollection.getElementType(), false ); } else { if ( log.isDebugEnabled() ) { log.debug( "createManyToMany() : path = " + path + " role = " + role + " associatedEntityName = " + associatedEntityName ); } elem = createManyToMany( role, associatedEntityName, roleAlias, entityPersister, ( EntityType ) queryableCollection.getElementType(), joinType ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); } elem.setCollectionTableAlias( roleAlias ); return elem; }
private void doPathExpression(String token, QueryTranslatorImpl q) throws QueryException { preprocess( token, q ); StringTokenizer tokens = new StringTokenizer( token, ".", true ); pathExpressionParser.start( q ); while ( tokens.hasMoreTokens() ) { pathExpressionParser.token( tokens.nextToken(), q ); } pathExpressionParser.end( q ); if ( pathExpressionParser.isCollectionValued() ) { openExpression( q, "" ); appendToken( q, pathExpressionParser.getCollectionSubquery( q.getEnabledFilters() ) ); closeExpression( q, "" ); // this is ugly here, but needed because its a subquery q.addQuerySpaces( q.getCollectionPersister( pathExpressionParser.getCollectionRole() ).getCollectionSpaces() ); } else { if ( pathExpressionParser.isExpectingCollectionIndex() ) { expectingIndex++; } else { addJoin( pathExpressionParser.getWhereJoin(), q ); appendToken( q, pathExpressionParser.getWhereColumn() ); } } }
private void doPathExpression(String token, QueryTranslatorImpl q) throws QueryException { preprocess( token, q ); StringTokenizer tokens = new StringTokenizer( token, ".", true ); pathExpressionParser.start( q ); while ( tokens.hasMoreTokens() ) { pathExpressionParser.token( tokens.nextToken(), q ); } pathExpressionParser.end( q ); if ( pathExpressionParser.isCollectionValued() ) { openExpression( q, "" ); appendToken( q, pathExpressionParser.getCollectionSubquery( q.getEnabledFilters() ) ); closeExpression( q, "" ); // this is ugly here, but needed because its a subquery q.addQuerySpaces( q.getCollectionPersister( pathExpressionParser.getCollectionRole() ).getCollectionSpaces() ); } else { if ( pathExpressionParser.isExpectingCollectionIndex() ) { expectingIndex++; } else { addJoin( pathExpressionParser.getWhereJoin(), q ); appendToken( q, pathExpressionParser.getWhereColumn() ); } } }
private void doPathExpression(String token, QueryTranslatorImpl q) throws QueryException { preprocess( token, q ); StringTokenizer tokens = new StringTokenizer( token, ".", true ); pathExpressionParser.start( q ); while ( tokens.hasMoreTokens() ) { pathExpressionParser.token( tokens.nextToken(), q ); } pathExpressionParser.end( q ); if ( pathExpressionParser.isCollectionValued() ) { openExpression( q, "" ); appendToken( q, pathExpressionParser.getCollectionSubquery( q.getEnabledFilters() ) ); closeExpression( q, "" ); // this is ugly here, but needed because its a subquery q.addQuerySpaces( q.getCollectionPersister( pathExpressionParser.getCollectionRole() ).getCollectionSpaces() ); } else { if ( pathExpressionParser.isExpectingCollectionIndex() ) { expectingIndex++; } else { addJoin( pathExpressionParser.getWhereJoin(), q ); appendToken( q, pathExpressionParser.getWhereColumn() ); } } }
private FromElement createEntityAssociation( String role, String roleAlias, JoinType joinType) throws SemanticException { FromElement elem; Queryable entityPersister = ( Queryable ) queryableCollection.getElementPersister(); String associatedEntityName = entityPersister.getEntityName(); // Get the class name of the associated entity. if ( queryableCollection.isOneToMany() ) { LOG.debugf( "createEntityAssociation() : One to many - path = %s role = %s associatedEntityName = %s", path, role, associatedEntityName ); JoinSequence joinSequence = createJoinSequence( roleAlias, joinType ); elem = createJoin( associatedEntityName, roleAlias, joinSequence, ( EntityType ) queryableCollection.getElementType(), false ); } else { LOG.debugf( "createManyToMany() : path = %s role = %s associatedEntityName = %s", path, role, associatedEntityName ); elem = createManyToMany( role, associatedEntityName, roleAlias, entityPersister, ( EntityType ) queryableCollection.getElementType(), joinType ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); } elem.setCollectionTableAlias( roleAlias ); return elem; }
private FromElement createCollectionJoin(JoinSequence collectionJoinSequence, String tableAlias) throws SemanticException { String text = queryableCollection.getTableName(); AST ast = createFromElement( text ); FromElement destination = ( FromElement ) ast; Type elementType = queryableCollection.getElementType(); if ( elementType.isCollectionType() ) { throw new SemanticException( "Collections of collections are not supported!" ); } destination.initializeCollection( fromClause, classAlias, tableAlias ); destination.setType( JOIN_FRAGMENT ); // Tag this node as a JOIN. destination.setIncludeSubclasses( false ); // Don't include subclasses in the join. destination.setCollectionJoin( true ); // This is a clollection join. destination.setJoinSequence( collectionJoinSequence ); destination.setOrigin( origin, false ); // origin.addDestination( destination ); // This was the cause of HHH-242 // origin.setType( FROM_FRAGMENT ); // Set the parent node type so that the AST is properly formed. origin.setText( "" ); // The destination node will have all the FROM text. origin.setCollectionJoin( true ); // The parent node is a collection join too (voodoo - see JoinProcessor) fromClause.addCollectionJoinFromElementByPath( path, destination ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); return destination; }
private FromElement createCollectionJoin(JoinSequence collectionJoinSequence, String tableAlias) throws SemanticException { String text = queryableCollection.getTableName(); AST ast = createFromElement( text ); FromElement destination = ( FromElement ) ast; Type elementType = queryableCollection.getElementType(); if ( elementType.isCollectionType() ) { throw new SemanticException( "Collections of collections are not supported!" ); } destination.initializeCollection( fromClause, classAlias, tableAlias ); destination.setType( JOIN_FRAGMENT ); // Tag this node as a JOIN. destination.setIncludeSubclasses( false ); // Don't include subclasses in the join. destination.setCollectionJoin( true ); // This is a clollection join. destination.setJoinSequence( collectionJoinSequence ); destination.setOrigin( origin, false ); destination.setCollectionTableAlias(tableAlias); // origin.addDestination( destination ); // This was the cause of HHH-242 // origin.setType( FROM_FRAGMENT ); // Set the parent node type so that the AST is properly formed. origin.setText( "" ); // The destination node will have all the FROM text. origin.setCollectionJoin( true ); // The parent node is a collection join too (voodoo - see JoinProcessor) fromClause.addCollectionJoinFromElementByPath( path, destination ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); return destination; }
private FromElement createCollectionJoin(JoinSequence collectionJoinSequence, String tableAlias) throws SemanticException { String text = queryableCollection.getTableName(); AST ast = createFromElement( text ); FromElement destination = ( FromElement ) ast; Type elementType = queryableCollection.getElementType(); if ( elementType.isCollectionType() ) { throw new SemanticException( "Collections of collections are not supported!" ); } destination.initializeCollection( fromClause, classAlias, tableAlias ); destination.setType( JOIN_FRAGMENT ); // Tag this node as a JOIN. destination.setIncludeSubclasses( false ); // Don't include subclasses in the join. destination.setCollectionJoin( true ); // This is a clollection join. destination.setJoinSequence( collectionJoinSequence ); destination.setOrigin( origin, false ); destination.setCollectionTableAlias(tableAlias); // origin.addDestination( destination ); // This was the cause of HHH-242 // origin.setType( FROM_FRAGMENT ); // Set the parent node type so that the AST is properly formed. origin.setText( "" ); // The destination node will have all the FROM text. origin.setCollectionJoin( true ); // The parent node is a collection join too (voodoo - see JoinProcessor) fromClause.addCollectionJoinFromElementByPath( path, destination ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); return destination; }
private FromElement createCollectionJoin(JoinSequence collectionJoinSequence, String tableAlias) throws SemanticException { String text = queryableCollection.getTableName(); AST ast = createFromElement( text ); FromElement destination = ( FromElement ) ast; Type elementType = queryableCollection.getElementType(); if ( elementType.isCollectionType() ) { throw new SemanticException( "Collections of collections are not supported!" ); } destination.initializeCollection( fromClause, classAlias, tableAlias ); destination.setType( JOIN_FRAGMENT ); // Tag this node as a JOIN. destination.setIncludeSubclasses( false ); // Don't include subclasses in the join. destination.setCollectionJoin( true ); // This is a clollection join. destination.setJoinSequence( collectionJoinSequence ); destination.setOrigin( origin, false ); destination.setCollectionTableAlias(tableAlias); // origin.addDestination( destination ); // This was the cause of HHH-242 // origin.setType( FROM_FRAGMENT ); // Set the parent node type so that the AST is properly formed. origin.setText( "" ); // The destination node will have all the FROM text. origin.setCollectionJoin( true ); // The parent node is a collection join too (voodoo - see JoinProcessor) fromClause.addCollectionJoinFromElementByPath( path, destination ); fromClause.getWalker().addQuerySpaces( queryableCollection.getCollectionSpaces() ); return destination; }