Examples of showAst()


Examples of org.hibernate.hql.ast.util.ASTPrinter.showAst()

    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

Examples of org.hibernate.hql.internal.ast.HqlParser.showAst()

      parser.statement();
      AST hqlAst = parser.getAST();

      if (logger.isDebugEnabled()) {
        logger.debug("First-level parse tree for " + namedQuery.name() + ":");
        parser.showAst(hqlAst, System.out);
      }

      SessionImplementor hibernateSession = em.unwrap(SessionImplementor.class);
      ASTQueryTranslatorFactory translatorFactory = new ASTQueryTranslatorFactory();
      query = (QueryTranslatorImpl) translatorFactory.createQueryTranslator(
View Full Code Here

Examples of org.hibernate.hql.internal.ast.HqlParser.showAst()

      parser.statement();
      AST hqlAst = parser.getAST();

      if (logger.isDebugEnabled()) {
        logger.debug("First-level parse tree for " + namedQuery.name() + ":");
        parser.showAst(hqlAst, System.out);
      }

      SessionImplementor hibernateSession = em.unwrap(SessionImplementor.class);
      ASTQueryTranslatorFactory translatorFactory = new ASTQueryTranslatorFactory();
      query = (QueryTranslatorImpl) translatorFactory.createQueryTranslator(
View Full Code Here

Examples of org.hibernate.hql.internal.ast.HqlParser.showAst()

      parser.statement();
      AST hqlAst = parser.getAST();

      if (logger.isDebugEnabled()) {
        logger.debug("First-level parse tree for " + namedQuery.name() + ":");
        parser.showAst(hqlAst, System.out);
      }

      SessionImplementor hibernateSession = em.unwrap(SessionImplementor.class);
      ASTQueryTranslatorFactory translatorFactory = new ASTQueryTranslatorFactory();
      query = (QueryTranslatorImpl) translatorFactory.createQueryTranslator(
View Full Code Here

Examples of org.hibernate.hql.internal.ast.HqlParser.showAst()

    try {
      HqlParser parser = HqlParser.getInstance(jpaQuery);
      parser.statement();
      AST hqlAst = parser.getAST();
      parser.showAst(hqlAst, System.out);

      SessionImplementor hibernateSession = em.unwrap(SessionImplementor.class);
      ASTQueryTranslatorFactory translatorFactory = new ASTQueryTranslatorFactory();
      query = (QueryTranslatorImpl) translatorFactory.createQueryTranslator(
              namedQuery.name(), jpaQuery, java.util.Collections.EMPTY_MAP, hibernateSession.getFactory());
View Full Code Here

Examples of org.hibernate.hql.internal.ast.HqlParser.showAst()

      parser.statement();
      AST hqlAst = parser.getAST();

      if (logger.isDebugEnabled()) {
        logger.debug("First-level parse tree for " + namedQuery.name() + ":");
        parser.showAst(hqlAst, System.out);
      }

      SessionImplementor hibernateSession = em.unwrap(SessionImplementor.class);
      ASTQueryTranslatorFactory translatorFactory = new ASTQueryTranslatorFactory();
      query = (QueryTranslatorImpl) translatorFactory.createQueryTranslator(
View Full Code Here

Examples of org.hibernate.hql.internal.ast.HqlParser.showAst()

            HqlParser parser = HqlParser.getInstance(input);
            parser.setFilter(false);
            parser.statement();
            AST ast = parser.getAST();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            parser.showAst(ast, new PrintStream(baos));
            assertEquals("At least one error occurred during parsing " + input,
                    0, parser.getParseErrorHandler().getErrorCount());
        } finally {
            // clear();
        }
View Full Code Here

Examples of org.hibernate.hql.internal.ast.HqlParser.showAst()

      parser.statement();
      AST hqlAst = parser.getAST();

      if (logger.isDebugEnabled()) {
        logger.debug("First-level parse tree for " + namedQuery.name() + ":");
        parser.showAst(hqlAst, System.out);
      }

      SessionImplementor hibernateSession = em.unwrap(SessionImplementor.class);
      ASTQueryTranslatorFactory translatorFactory = new ASTQueryTranslatorFactory();
      query = (QueryTranslatorImpl) translatorFactory.createQueryTranslator(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.