Package org.hibernate.sql.ast.origin.hql.parse

Examples of org.hibernate.sql.ast.origin.hql.parse.HQLParser


  @Override
  public Query getParsedQueryExecutor(Session session, String queryString, Map<String, Object> namedParameters) {
    HQLLexer lexed = new HQLLexer( new ANTLRStringStream( queryString ) );
    TokenStream tokens = new CommonTokenStream( lexed );
    HQLParser parser = new HQLParser( tokens );
    try {
      //TODO move the following logic into the hibernate-jpql-parser project?
      //needs to consider usage of a parsed query plans cache

      // parser#statement() is the entry point for evaluation of any kind of statement
      HQLParser.statement_return r = parser.statement();
      CommonTree tree = (CommonTree) r.getTree();
      // To walk the resulting tree we need a treenode stream:
      CommonTreeNodeStream treeStream = new CommonTreeNodeStream( tree );
      // AST nodes have payloads referring to the tokens from the Lexer:
      treeStream.setTokenStream( tokens );
View Full Code Here

TOP

Related Classes of org.hibernate.sql.ast.origin.hql.parse.HQLParser

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.