@Override public void setText(String s) { super.setText( s ); }
public FromElementType(FromElement fromElement, EntityPersister persister, EntityType entityType) { this.fromElement = fromElement; this.persister = persister; this.entityType = entityType; if ( persister != null ) { fromElement.setText( ( (Queryable) persister ).getTableName() + " " + getTableAlias() ); } }
public void setQueryableCollection(QueryableCollection queryableCollection) { if ( this.queryableCollection != null ) { throw new IllegalStateException( "QueryableCollection is already defined for " + this + "!" ); } this.queryableCollection = queryableCollection; if ( !queryableCollection.isOneToMany() ) { // For many-to-many joins, use the tablename from the queryable collection for the default text. fromElement.setText( queryableCollection.getTableName() + " " + getTableAlias() ); } }
fromElement.getOrigin().getJoinSequence().addJoin( (ImpliedFromElement) fromElement ); fromElement.setText( "" );
private void prepareAnyImplicitJoins(DotNode dotNode) throws SemanticException { if ( dotNode.getLhs() instanceof DotNode ) { DotNode lhs = (DotNode) dotNode.getLhs(); FromElement lhsOrigin = lhs.getFromElement(); if ( lhsOrigin != null && "".equals( lhsOrigin.getText() ) ) { String lhsOriginText = lhsOrigin.getQueryable().getTableName() + " " + lhsOrigin.getTableAlias(); lhsOrigin.setText( lhsOriginText ); } prepareAnyImplicitJoins( lhs ); } }
protected void postProcessDML(RestrictableStatement statement) throws SemanticException { statement.getFromClause().resolve(); FromElement fromElement = (FromElement) statement.getFromClause().getFromElements().get( 0 ); Queryable persister = fromElement.getQueryable(); // Make #@%$^#^&# sure no alias is applied to the table name fromElement.setText( persister.getTableName() ); // // append any filter fragments; the EMPTY_MAP is used under the assumption that // // currently enabled filters should not affect this process // if ( persister.getDiscriminatorType() != null ) { // new SyntheticAndFactory( getASTFactory() ).addDiscriminatorWhereFragment( // statement, // persister, // java.util.Collections.EMPTY_MAP, // fromElement.getTableAlias() // ); // } if ( persister.getDiscriminatorType() != null || !queryTranslatorImpl.getEnabledFilters().isEmpty() ) { new SyntheticAndFactory( this ).addDiscriminatorWhereFragment( statement, persister, queryTranslatorImpl.getEnabledFilters(), fromElement.getTableAlias() ); } }
fromElement.setText( "" ); fromElement.setUseWhereFragment( false );
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; }
elem.setText( "" ); elem.setUseWhereFragment( false );
public FromElementType(FromElement fromElement, EntityPersister persister, EntityType entityType) { this.fromElement = fromElement; this.persister = persister; this.entityType = entityType; if ( persister != null ) { fromElement.setText( ( ( Queryable ) persister ).getTableName() + " " + getTableAlias() ); } }
public FromElementType(FromElement fromElement, EntityPersister persister, EntityType entityType) { this.fromElement = fromElement; this.persister = persister; this.entityType = entityType; if ( persister != null ) { fromElement.setText( ( ( Queryable ) persister ).getTableName() + " " + getTableAlias() ); } }
public void setQueryableCollection(QueryableCollection queryableCollection) { if ( this.queryableCollection != null ) { throw new IllegalStateException( "QueryableCollection is already defined for " + this + "!" ); } this.queryableCollection = queryableCollection; if ( !queryableCollection.isOneToMany() ) { // For many-to-many joins, use the tablename from the queryable collection for the default text. fromElement.setText( queryableCollection.getTableName() + " " + getTableAlias() ); } }
public void setQueryableCollection(QueryableCollection queryableCollection) { if ( this.queryableCollection != null ) { throw new IllegalStateException( "QueryableCollection is already defined for " + this + "!" ); } this.queryableCollection = queryableCollection; if ( !queryableCollection.isOneToMany() ) { // For many-to-many joins, use the tablename from the queryable collection for the default text. fromElement.setText( queryableCollection.getTableName() + " " + getTableAlias() ); } }
private void prepareAnyImplicitJoins(DotNode dotNode) throws SemanticException { if ( dotNode.getLhs() instanceof DotNode ) { DotNode lhs = ( DotNode ) dotNode.getLhs(); FromElement lhsOrigin = lhs.getFromElement(); if ( lhsOrigin != null && "".equals( lhsOrigin.getText() ) ) { String lhsOriginText = lhsOrigin.getQueryable().getTableName() + " " + lhsOrigin.getTableAlias(); lhsOrigin.setText( lhsOriginText ); } prepareAnyImplicitJoins( lhs ); } }
private void prepareAnyImplicitJoins(DotNode dotNode) throws SemanticException { if ( dotNode.getLhs() instanceof DotNode ) { DotNode lhs = ( DotNode ) dotNode.getLhs(); FromElement lhsOrigin = lhs.getFromElement(); if ( lhsOrigin != null && "".equals( lhsOrigin.getText() ) ) { String lhsOriginText = lhsOrigin.getQueryable().getTableName() + " " + lhsOrigin.getTableAlias(); lhsOrigin.setText( lhsOriginText ); } prepareAnyImplicitJoins( lhs ); } }
protected void postProcessDML(RestrictableStatement statement) throws SemanticException { statement.getFromClause().resolve(); FromElement fromElement = ( FromElement ) statement.getFromClause().getFromElements().get( 0 ); Queryable persister = fromElement.getQueryable(); // Make #@%$^#^&# sure no alias is applied to the table name fromElement.setText( persister.getTableName() ); // // append any filter fragments; the EMPTY_MAP is used under the assumption that // // currently enabled filters should not affect this process // if ( persister.getDiscriminatorType() != null ) { // new SyntheticAndFactory( getASTFactory() ).addDiscriminatorWhereFragment( // statement, // persister, // java.util.Collections.EMPTY_MAP, // fromElement.getTableAlias() // ); // } if ( persister.getDiscriminatorType() != null || ! queryTranslatorImpl.getEnabledFilters().isEmpty() ) { new SyntheticAndFactory( this ).addDiscriminatorWhereFragment( statement, persister, queryTranslatorImpl.getEnabledFilters(), fromElement.getTableAlias() ); } }
protected void postProcessDML(RestrictableStatement statement) throws SemanticException { statement.getFromClause().resolve(); FromElement fromElement = ( FromElement ) statement.getFromClause().getFromElements().get( 0 ); Queryable persister = fromElement.getQueryable(); // Make #@%$^#^&# sure no alias is applied to the table name fromElement.setText( persister.getTableName() ); // // append any filter fragments; the EMPTY_MAP is used under the assumption that // // currently enabled filters should not affect this process // if ( persister.getDiscriminatorType() != null ) { // new SyntheticAndFactory( getASTFactory() ).addDiscriminatorWhereFragment( // statement, // persister, // java.util.Collections.EMPTY_MAP, // fromElement.getTableAlias() // ); // } if ( persister.getDiscriminatorType() != null || ! queryTranslatorImpl.getEnabledFilters().isEmpty() ) { new SyntheticAndFactory( this ).addDiscriminatorWhereFragment( statement, persister, queryTranslatorImpl.getEnabledFilters(), fromElement.getTableAlias() ); } }
fromElement.setText( "" ); fromElement.setUseWhereFragment( false );
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; }