Package org.hibernate.hql.ast.util

Examples of org.hibernate.hql.ast.util.ASTPrinter


    // Transform the tree.
    w.statement( hqlAst );

    if ( AST_LOG.isDebugEnabled() ) {
      ASTPrinter printer = new ASTPrinter( SqlTokenTypes.class );
      AST_LOG.debug( printer.showAsString( w.getAST(), "--- SQL AST ---" ) );
    }

    w.getParseErrorHandler().throwQueryException();

    return w;
View Full Code Here


    return parser;
  }

  void showHqlAst(AST hqlAst) {
    if ( AST_LOG.isDebugEnabled() ) {
      ASTPrinter printer = new ASTPrinter( HqlTokenTypes.class );
      printer.setShowClassNames( false ); // The class names aren't interesting in the first tree.
      AST_LOG.debug( printer.showAsString( hqlAst, "--- HQL AST ---" ) );
    }
  }
View Full Code Here

  private ParseErrorHandler parseErrorHandler;
  private ASTPrinter printer = getASTPrinter();

  private static ASTPrinter getASTPrinter() {
    return new ASTPrinter( org.hibernate.hql.antlr.HqlTokenTypes.class );
  }
View Full Code Here

    this.queryTranslatorImpl = qti;
    this.sessionFactoryHelper = new SessionFactoryHelper( sfi );
    this.literalProcessor = new LiteralProcessor( this );
    this.tokenReplacements = tokenReplacements;
    this.hqlParser = parser;
    this.printer = new ASTPrinter( SqlTokenTypes.class );
    this.collectionFilterRole = collectionRole;
  }
View Full Code Here

    this.sessionFactoryHelper = new SessionFactoryHelper( sfi );
    this.literalProcessor = new LiteralProcessor( this );
    this.tokenReplacements = tokenReplacements;
    this.collectionFilterRole = collectionRole;
    this.hqlParser = parser;
    this.printer = new ASTPrinter( SqlTokenTypes.class );
  }
View Full Code Here

  public void testSimpleTree() throws Exception {
    String input = "select foo from foo in class org.hibernate.test.Foo, fee in class org.hibernate.test.Fee where foo.dependent = fee order by foo.string desc, foo.component.count asc, fee.id";
    HqlParser parser = HqlParser.getInstance( input );
    parser.statement();
    AST ast = parser.getAST();
    ASTPrinter printer = new ASTPrinter( HqlTokenTypes.class );
    printer.showAst( ast, new PrintWriter( System.out ) );
    ASTIterator iterator = new ASTIterator( ast );
    int count = 0;
    while ( iterator.hasNext() ) {
      assertTrue( iterator.next() instanceof AST );
      count++;
View Full Code Here

    // Transform the tree.
    w.statement( hqlAst );

    if ( AST_LOG.isDebugEnabled() ) {
      ASTPrinter printer = new ASTPrinter( SqlTokenTypes.class );
      AST_LOG.debug( printer.showAsString( w.getAST(), "--- SQL AST ---" ) );
    }

    w.getParseErrorHandler().throwQueryException();

    return w;
View Full Code Here

    return parser;
  }

  void showHqlAst(AST hqlAst) {
    if ( AST_LOG.isDebugEnabled() ) {
      ASTPrinter printer = new ASTPrinter( HqlTokenTypes.class );
      printer.setShowClassNames( false ); // The class names aren't interesting in the first tree.
      AST_LOG.debug( printer.showAsString( hqlAst, "--- HQL AST ---" ) );
    }
  }
View Full Code Here

    this.queryTranslatorImpl = qti;
    this.sessionFactoryHelper = new SessionFactoryHelper( sfi );
    this.literalProcessor = new LiteralProcessor( this );
    this.tokenReplacements = tokenReplacements;
    this.hqlParser = parser;
    this.printer = new ASTPrinter( SqlTokenTypes.class );
    this.collectionFilterRole = collectionRole;
  }
View Full Code Here

    this.sessionFactoryHelper = new SessionFactoryHelper( sfi );
    this.literalProcessor = new LiteralProcessor( this );
    this.tokenReplacements = tokenReplacements;
    this.collectionFilterRole = collectionRole;
    this.hqlParser = parser;
    this.printer = new ASTPrinter( SqlTokenTypes.class );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.hql.ast.util.ASTPrinter

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.