Package org.hibernate.hql.ast.tree

Examples of org.hibernate.hql.ast.tree.FromClause


    return fromElement;
  }

  protected AST createFromFilterElement(AST filterEntity, AST alias) throws SemanticException {
    FromElement fromElement = currentFromClause.addFromElement( filterEntity.getText(), alias );
    FromClause fromClause = fromElement.getFromClause();
    QueryableCollection persister = sessionFactoryHelper.getCollectionPersister( collectionFilterRole );
    // Get the names of the columns used to link between the collection
    // owner and the collection elements.
    String[] keyColumnNames = persister.getKeyColumnNames();
    String fkTableAlias = persister.isOneToMany()
        ? fromElement.getTableAlias()
        : fromClause.getAliasGenerator().createName( collectionFilterRole );
    JoinSequence join = sessionFactoryHelper.createJoinSequence();
    join.setRoot( persister, fkTableAlias );
    if ( !persister.isOneToMany() ) {
      join.addJoin( ( AssociationType ) persister.getElementType(),
          fromElement.getTableAlias(),
View Full Code Here


   *
   * @param fromNode      The new 'FROM' context.
   * @param inputFromNode The from node from the input AST.
   */
  protected void pushFromClause(AST fromNode, AST inputFromNode) {
    FromClause newFromClause = ( FromClause ) fromNode;
    newFromClause.setParentFromClause( currentFromClause );
    currentFromClause = newFromClause;
  }
View Full Code Here

    }
  }

  protected void beforeSelectClause() throws SemanticException {
    // Turn off includeSubclasses on all FromElements.
    FromClause from = getCurrentFromClause();
    List fromElements = from.getFromElements();
    for ( Iterator iterator = fromElements.iterator(); iterator.hasNext(); ) {
      FromElement fromElement = ( FromElement ) iterator.next();
      fromElement.setIncludeSubclasses( false );
    }
  }
View Full Code Here

  public SelectClause getSelectClause() {
    return selectClause;
  }
 
  public FromClause getFinalFromClause() {
    FromClause top = currentFromClause;
    while ( top.getParentFromClause() != null ) {
      top = top.getParentFromClause();
    }
    return top;
  }
View Full Code Here

    return intoClause;
  }

  protected void prepareVersioned(AST updateNode, AST versioned) throws SemanticException {
    UpdateStatement updateStatement = ( UpdateStatement ) updateNode;
    FromClause fromClause = updateStatement.getFromClause();
    if ( versioned != null ) {
      // Make sure that the persister is versioned
      Queryable persister = fromClause.getFromElement().getQueryable();
      if ( !persister.isVersioned() ) {
        throw new SemanticException( "increment option specified for update of non-versioned entity" );
      }

      VersionType versionType = persister.getVersionType();
View Full Code Here

  public LiteralProcessor(HqlSqlWalker hqlSqlWalker) {
    this.walker = hqlSqlWalker;
  }

  public boolean isAlias(String alias) {
    FromClause from = walker.getCurrentFromClause();
    while ( from.isSubQuery() ) {
      if ( from.containsClassAlias(alias) ) {
        return true;
      }
      from = from.getParentFromClause();
    }
    return from.containsClassAlias(alias);
  }
View Full Code Here

    return fromElement;
  }

  protected AST createFromFilterElement(AST filterEntity, AST alias) throws SemanticException {
    FromElement fromElement = currentFromClause.addFromElement( filterEntity.getText(), alias );
    FromClause fromClause = fromElement.getFromClause();
    QueryableCollection persister = sessionFactoryHelper.getCollectionPersister( collectionFilterRole );
    // Get the names of the columns used to link between the collection
    // owner and the collection elements.
    String[] keyColumnNames = persister.getKeyColumnNames();
    String fkTableAlias = persister.isOneToMany()
        ? fromElement.getTableAlias()
        : fromClause.getAliasGenerator().createName( collectionFilterRole );
    JoinSequence join = sessionFactoryHelper.createJoinSequence();
    join.setRoot( persister, fkTableAlias );
    if ( !persister.isOneToMany() ) {
      join.addJoin( ( AssociationType ) persister.getElementType(),
          fromElement.getTableAlias(),
View Full Code Here

   *
   * @param fromNode      The new 'FROM' context.
   * @param inputFromNode The from node from the input AST.
   */
  protected void pushFromClause(AST fromNode, AST inputFromNode) {
    FromClause newFromClause = ( FromClause ) fromNode;
    newFromClause.setParentFromClause( currentFromClause );
    currentFromClause = newFromClause;
  }
View Full Code Here

    }
  }

  protected void beforeSelectClause() throws SemanticException {
    // Turn off includeSubclasses on all FromElements.
    FromClause from = getCurrentFromClause();
    List fromElements = from.getFromElements();
    for ( Iterator iterator = fromElements.iterator(); iterator.hasNext(); ) {
      FromElement fromElement = ( FromElement ) iterator.next();
      fromElement.setIncludeSubclasses( false );
    }
  }
View Full Code Here

  public SelectClause getSelectClause() {
    return selectClause;
  }
 
  public FromClause getFinalFromClause() {
    FromClause top = currentFromClause;
    while ( top.getParentFromClause() != null ) {
      top = top.getParentFromClause();
    }
    return top;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.hql.ast.tree.FromClause

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.