Package org.hibernate.hql.testutil

Examples of org.hibernate.hql.testutil.TestingParserContext


public class ParsingTest {

  @Test
  public void testFromAnimal() {
    ParserContext context = new TestingParserContext( "Animal" );
    //generated alias:
    assertTreeParsed( context, "from Animal",
      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF Animal <gen:0>))) (SELECT (SELECT_LIST (SELECT_ITEM <gen:0>))))))");
  }
View Full Code Here


      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF Animal <gen:0>))) (SELECT (SELECT_LIST (SELECT_ITEM <gen:0>))))))");
  }

  @Test
  public void testSuperSimpleQuery() {
    ParserContext context = new TestingParserContext( "EntityName" );
    //generated alias:
    assertTreeParsed( context, "from EntityName",
      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF EntityName <gen:0>))) (SELECT (SELECT_LIST (SELECT_ITEM <gen:0>))))))");
  }
View Full Code Here

      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF EntityName <gen:0>))) (SELECT (SELECT_LIST (SELECT_ITEM <gen:0>))))))");
  }

  @Test
  public void testSimpleQuery() {
    ParserContext context = new TestingParserContext( "com.acme.EntityName" );
    //full selection with specified alias:
    assertTreeParsed( context, "select e from com.acme.EntityName e",
      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF com.acme.EntityName e))) (select (SELECT_LIST (SELECT_ITEM (PATH e)))))))");
  }
View Full Code Here

      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF com.acme.EntityName e))) (select (SELECT_LIST (SELECT_ITEM (PATH e)))))))");
  }

  @Test
  public void testSimpleFromQuery() {
    ParserContext context = new TestingParserContext( "com.acme.EntityName" );
    //abbreviated form:
    assertTreeParsed( context, "from com.acme.EntityName e",
      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF com.acme.EntityName e))) (SELECT (SELECT_LIST (SELECT_ITEM e))))))");
  }
View Full Code Here

TOP

Related Classes of org.hibernate.hql.testutil.TestingParserContext

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.