Package org.hibernate.engine.query.sql

Examples of org.hibernate.engine.query.sql.NativeSQLQueryScalarReturn


    check( true, r6, new NativeSQLQueryCollectionReturn( "b", "c", "a", Collections.singletonMap( "key", "value" ), LockMode.NONE ) );
    check( true, r7, new NativeSQLQueryCollectionReturn( "b", "c", "a", null, LockMode.NONE ) );
  }

  public void testNativeSQLQueryReturnTypes() {
    NativeSQLQueryScalarReturn r1 = new NativeSQLQueryScalarReturn( "a", TypeFactory.basic( "int" ) );
    NativeSQLQueryRootReturn r2 = new NativeSQLQueryRootReturn( "a", "b", LockMode.NONE );
    NativeSQLQueryJoinReturn r3 = new NativeSQLQueryJoinReturn( "a", "b", "c", Collections.singletonMap( "key", "value" ), LockMode.NONE );
    NativeSQLQueryCollectionReturn r4 = new NativeSQLQueryCollectionReturn( "a", "b", "c", Collections.singletonMap( "key", "value" ), LockMode.NONE);

    check( false, r1, r2 );
View Full Code Here


  private NativeSQLQuerySpecification createSpec() {
    String blah = "blah";
    String select = "select blah from blah";
    NativeSQLQueryReturn[] queryReturns =
      new NativeSQLQueryScalarReturn[] {new NativeSQLQueryScalarReturn(blah, TypeFactory.basic( "int" ) ) };
    NativeSQLQuerySpecification spec = new NativeSQLQuerySpecification(select,
      queryReturns, null);
    return spec;
  }
View Full Code Here

    else {
      Iterator itr = queryReturns.iterator();
      while ( itr.hasNext() ) {
        NativeSQLQueryReturn rtn = ( NativeSQLQueryReturn ) itr.next();
        if ( rtn instanceof NativeSQLQueryScalarReturn ) {
          NativeSQLQueryScalarReturn scalar = ( NativeSQLQueryScalarReturn ) rtn;
          if ( scalar.getType() == null ) {
            autodiscovertypes = true;
            break;
          }
        }
      }
View Full Code Here

    //we never need to apply locks to the SQL
    return CollectionHelper.EMPTY_MAP;
  }

  public SQLQuery addScalar(String columnAlias, Type type) {
    queryReturns.add( new NativeSQLQueryScalarReturn( columnAlias, type ) );
    return this;
  }
View Full Code Here

    return this;
  }

  public SQLQuery addScalar(String columnAlias) {
    autodiscovertypes = true;
    queryReturns.add( new NativeSQLQueryScalarReturn( columnAlias, null ) );
    return this;
  }
View Full Code Here

          );
      definition.addQueryReturn( result );
    }

    for (ColumnResult column : ann.columns()) {
      definition.addQueryReturn( new NativeSQLQueryScalarReturn( column.name(), null ) );
    }

    if ( isDefault ) {
      mappings.addDefaultResultSetMapping( definition );
    }
View Full Code Here

    else {
      Iterator itr = queryReturns.iterator();
      while ( itr.hasNext() ) {
        NativeSQLQueryReturn rtn = ( NativeSQLQueryReturn ) itr.next();
        if ( rtn instanceof NativeSQLQueryScalarReturn ) {
          NativeSQLQueryScalarReturn scalar = ( NativeSQLQueryScalarReturn ) rtn;
          if ( scalar.getType() == null ) {
            autodiscovertypes = true;
            break;
          }
        }
      }
View Full Code Here

    //we never need to apply locks to the SQL
    return null;
  }

  public SQLQuery addScalar(String columnAlias, Type type) {
    queryReturns.add( new NativeSQLQueryScalarReturn( columnAlias, type ) );
    return this;
  }
View Full Code Here

    return this;
  }

  public SQLQuery addScalar(String columnAlias) {
    autodiscovertypes = true;
    queryReturns.add( new NativeSQLQueryScalarReturn( columnAlias, null ) );
    return this;
  }
View Full Code Here

      definition.addQueryReturn( result );
    }

    for ( ColumnResult column : ann.columns() ) {
      definition.addQueryReturn(
          new NativeSQLQueryScalarReturn(
              mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(
                  column.name()
              ),
              null
          )
View Full Code Here

TOP

Related Classes of org.hibernate.engine.query.sql.NativeSQLQueryScalarReturn

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.