Package org.hibernate.hql

Examples of org.hibernate.hql.HolderInstantiator


  }

  protected List getResultList(List results, ResultTransformer resultTransformer) throws QueryException {
    // meant to handle dynamic instantiation queries...
    HolderInstantiator holderInstantiator = HolderInstantiator.getHolderInstantiator(selectNewTransformer, resultTransformer, queryReturnAliases);
    if ( holderInstantiator.isRequired() ) {
      for ( int i = 0; i < results.size(); i++ ) {
        Object[] row = ( Object[] ) results.get( i );
        Object result = holderInstantiator.instantiate(row);
        results.set( i, result );
      }

      if(!hasSelectNew() && resultTransformer!=null) {
        return resultTransformer.transformList(results);
View Full Code Here


    try {

      PreparedStatement st = prepareQueryStatement( queryParameters, false, session );
      ResultSet rs = getResultSet( st, queryParameters.hasAutoDiscoverScalarTypes(), false, queryParameters.getRowSelection(), session );
      HolderInstantiator hi = HolderInstantiator.createClassicHolderInstantiator(holderConstructor, queryParameters.getResultTransformer());
      Iterator result = new IteratorImpl( rs, st, session, returnTypes, getColumnNames(), hi );

      if ( stats ) {
        session.getFactory().getStatisticsImplementor().queryExecuted(
            "HQL: " + queryString,
View Full Code Here

  }

  public ScrollableResults scroll(final QueryParameters queryParameters,
                  final SessionImplementor session)
      throws HibernateException {
    HolderInstantiator hi = HolderInstantiator.createClassicHolderInstantiator(holderConstructor, queryParameters.getResultTransformer());
    return scroll( queryParameters, returnTypes, hi, session );
  }
View Full Code Here

    try {

      PreparedStatement st = prepareQueryStatement( queryParameters, false, session );
      ResultSet rs = getResultSet( st, queryParameters.hasAutoDiscoverScalarTypes(), false, queryParameters.getRowSelection(), session );
      HolderInstantiator hi = HolderInstantiator.createClassicHolderInstantiator(holderConstructor, queryParameters.getResultTransformer());
      Iterator result = new IteratorImpl( rs, st, session, queryParameters.isReadOnly( session ), returnTypes, getColumnNames(), hi );

      if ( stats ) {
        session.getFactory().getStatisticsImplementor().queryExecuted(
            "HQL: " + queryString,
View Full Code Here

  }

  public ScrollableResults scroll(final QueryParameters queryParameters,
                  final SessionImplementor session)
      throws HibernateException {
    HolderInstantiator hi = HolderInstantiator.createClassicHolderInstantiator(holderConstructor, queryParameters.getResultTransformer());
    return scroll( queryParameters, returnTypes, hi, session );
  }
View Full Code Here

    return resultRow;
  }

  protected List getResultList(List results, ResultTransformer resultTransformer) throws QueryException {
    // meant to handle dynamic instantiation queries...
    HolderInstantiator holderInstantiator = HolderInstantiator.getHolderInstantiator(selectNewTransformer, resultTransformer, queryReturnAliases);
    if ( holderInstantiator.isRequired() ) {
      for ( int i = 0; i < results.size(); i++ ) {
        Object[] row = ( Object[] ) results.get( i );
        Object result = holderInstantiator.instantiate(row);
        results.set( i, result );
      }

      if(!hasSelectNew() && resultTransformer!=null) {
        return resultTransformer.transformList(results);
View Full Code Here

  static private HolderInstantiator getHolderInstantiator(ResultTransformer resultTransformer, String[] queryReturnAliases) {
    if ( resultTransformer != null ) {
      return HolderInstantiator.NOOP_INSTANTIATOR;
    }
    else {
      return new HolderInstantiator(resultTransformer, queryReturnAliases);
    }
  }
View Full Code Here

    return rowProcessor.buildResultRow( row, rs, session );
  }
 
  protected List getResultList(List results, ResultTransformer resultTransformer) throws QueryException {
    // meant to handle dynamic instantiation queries...(Copy from QueryLoader)
    HolderInstantiator holderInstantiator = HolderInstantiator.getHolderInstantiator(
        null,
        resultTransformer,
        getReturnAliasesForTransformer()
    );
    if ( holderInstantiator.isRequired() ) {
      for ( int i = 0; i < results.size(); i++ ) {
        Object[] row = ( Object[] ) results.get( i );
        Object result = holderInstantiator.instantiate(row);
        results.set( i, result );
      }
     
      return resultTransformer.transformList(results);
    }
View Full Code Here

    try {

      PreparedStatement st = prepareQueryStatement( queryParameters, false, session );
      ResultSet rs = getResultSet( st, queryParameters.hasAutoDiscoverScalarTypes(), false, queryParameters.getRowSelection(), session );
      HolderInstantiator hi = HolderInstantiator.createClassicHolderInstantiator(holderConstructor, queryParameters.getResultTransformer());
      Iterator result = new IteratorImpl( rs, st, session, returnTypes, getColumnNames(), hi );

      if ( stats ) {
        session.getFactory().getStatisticsImplementor().queryExecuted(
            "HQL: " + queryString,
View Full Code Here

  }

  public ScrollableResults scroll(final QueryParameters queryParameters,
                  final SessionImplementor session)
      throws HibernateException {
    HolderInstantiator hi = HolderInstantiator.createClassicHolderInstantiator(holderConstructor, queryParameters.getResultTransformer());
    return scroll( queryParameters, returnTypes, hi, session );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.hql.HolderInstantiator

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.