Package org.hibernate.hql.classic

Examples of org.hibernate.hql.classic.ClassicQueryTranslatorFactory


  protected void runClassicTranslator(String hql) throws Exception {
    SessionFactoryImplementor factory = getSessionFactoryImplementor();
    Map replacements = new HashMap();
    QueryTranslator oldQueryTranslator = null;
    try {
      QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
      oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, factory );
      oldQueryTranslator.compile( replacements, false );
    }
    catch ( Exception e ) {
      e.printStackTrace();
      throw e;
View Full Code Here


    // steve -> note that the empty maps here represent the currently enabled filters...
    QueryTranslator oldQueryTranslator = null;
    Exception oldException = null;
    try {
      System.out.println("Compiling with classic QueryTranslator...");
      QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
      oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, factory );
      oldQueryTranslator.compile( replacements, scalar );
    }
    catch ( QueryException e ) {
      oldException = e;
    }
View Full Code Here

    assertEquals( "incorrect return type", Hibernate.BIG_DECIMAL, translator.getReturnTypes()[0] );

    // special case to test classicquery special case handling of count(*)
    QueryTranslator oldQueryTranslator = null;
    String hql = "select count(*) from Human h";
    QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
    oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, sfi() );
    oldQueryTranslator.compile( Collections.EMPTY_MAP, true);
    assertEquals( "incorrect return type count", 1, oldQueryTranslator.getReturnTypes().length );
    assertEquals( "incorrect return type", Hibernate.INTEGER, oldQueryTranslator.getReturnTypes()[0] );

  }
View Full Code Here

    assertEquals( "incorrect return type", Hibernate.BIG_DECIMAL, translator.getReturnTypes()[0] );

    // special case to test classicquery special case handling of count(*)
    QueryTranslator oldQueryTranslator = null;
    String hql = "select count(*) from Human h";
    QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
    oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, getSessionFactoryImplementor() );
    oldQueryTranslator.compile( Collections.EMPTY_MAP, true);
    assertEquals( "incorrect return type count", 1, oldQueryTranslator.getReturnTypes().length );
    assertEquals( "incorrect return type", Hibernate.LONG, oldQueryTranslator.getReturnTypes()[0] );

  }
View Full Code Here

  protected void runClassicTranslator(String hql) throws Exception {
    SessionFactoryImplementor factory = getSessionFactoryImplementor();
    Map replacements = new HashMap();
    QueryTranslator oldQueryTranslator = null;
    try {
      QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
      oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, factory );
      oldQueryTranslator.compile( replacements, false );
    }
    catch ( Exception e ) {
      e.printStackTrace();
      throw e;
View Full Code Here

    // steve -> note that the empty maps here represent the currently enabled filters...
    QueryTranslator oldQueryTranslator = null;
    Exception oldException = null;
    try {
      System.out.println("Compiling with classic QueryTranslator...");
      QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
      oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, factory );
      oldQueryTranslator.compile( replacements, scalar );
    }
    catch ( QueryException e ) {
      oldException = e;
    }
View Full Code Here

    assertEquals( "incorrect return type", Hibernate.BIG_DECIMAL, translator.getReturnTypes()[0] );

    // special case to test classicquery special case handling of count(*)
    QueryTranslator oldQueryTranslator = null;
    String hql = "select count(*) from Human h";
    QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
    oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, getSessionFactoryImplementor() );
    oldQueryTranslator.compile( Collections.EMPTY_MAP, true);
    assertEquals( "incorrect return type count", 1, oldQueryTranslator.getReturnTypes().length );
    assertEquals( "incorrect return type", Hibernate.LONG, oldQueryTranslator.getReturnTypes()[0] );

  }
View Full Code Here

  protected void runClassicTranslator(String hql) throws Exception {
    SessionFactoryImplementor factory = getSessionFactoryImplementor();
    Map replacements = new HashMap();
    QueryTranslator oldQueryTranslator = null;
    try {
      QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
      oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, factory );
      oldQueryTranslator.compile( replacements, false );
    }
    catch ( Exception e ) {
      e.printStackTrace();
      throw e;
View Full Code Here

    // steve -> note that the empty maps here represent the currently enabled filters...
    QueryTranslator oldQueryTranslator = null;
    Exception oldException = null;
    try {
      System.out.println("Compiling with classic QueryTranslator...");
      QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
      oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, factory );
      oldQueryTranslator.compile( replacements, scalar );
    }
    catch ( QueryException e ) {
      oldException = e;
    }
View Full Code Here

    assertEquals( "incorrect return type", Hibernate.BIG_DECIMAL, translator.getReturnTypes()[0] );

    // special case to test classicquery special case handling of count(*)
    QueryTranslator oldQueryTranslator = null;
    String hql = "select count(*) from Human h";
    QueryTranslatorFactory classic = new ClassicQueryTranslatorFactory();
    oldQueryTranslator = classic.createQueryTranslator( hql, hql, Collections.EMPTY_MAP, sfi() );
    oldQueryTranslator.compile( Collections.EMPTY_MAP, true);
    assertEquals( "incorrect return type count", 1, oldQueryTranslator.getReturnTypes().length );
    assertEquals( "incorrect return type", Hibernate.INTEGER, oldQueryTranslator.getReturnTypes()[0] );

  }
View Full Code Here

TOP

Related Classes of org.hibernate.hql.classic.ClassicQueryTranslatorFactory

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.