Package org.hibernate.engine.spi

Examples of org.hibernate.engine.spi.QueryParameters


      LOG.debugf( "Loading entity: %s", MessageHelper.infoString( persister, id, identifierType, getFactory() ) );
    }

    List result;
    try {
      QueryParameters qp = new QueryParameters();
      qp.setPositionalParameterTypes( new Type[] { identifierType } );
      qp.setPositionalParameterValues( new Object[] { id } );
      qp.setOptionalObject( optionalObject );
      qp.setOptionalEntityName( optionalEntityName );
      qp.setOptionalId( optionalIdentifier );
      qp.setLockOptions( lockOptions );
      result = doQueryAndInitializeNonLazyCollections( session, qp, false );
    }
    catch ( SQLException sqle ) {
      final Loadable[] persisters = getEntityPersisters();
      throw factory.getSQLExceptionHelper().convert(
View Full Code Here


    List result;
    try {
      result = doQueryAndInitializeNonLazyCollections(
          session,
          new QueryParameters(
              new Type[] { keyType, indexType },
              new Object[] { key, index }
          ),
          false
      );
View Full Code Here

    Type[] types = new Type[ids.length];
    Arrays.fill( types, idType );
    List result;
    try {
      QueryParameters qp = new QueryParameters();
      qp.setPositionalParameterTypes( types );
      qp.setPositionalParameterValues( ids );
      qp.setOptionalObject( optionalObject );
      qp.setOptionalEntityName( optionalEntityName );
      qp.setOptionalId( optionalId );
      qp.setLockOptions( lockOptions );
      result = doQueryAndInitializeNonLazyCollections( session, qp, false );
    }
    catch ( SQLException sqle ) {
      throw factory.getSQLExceptionHelper().convert(
              sqle,
View Full Code Here

    Serializable[] ids = new Serializable[]{id};
    try {
      doQueryAndInitializeNonLazyCollections(
          session,
          new QueryParameters( new Type[]{type}, ids, ids ),
          true
        );
    }
    catch ( SQLException sqle ) {
      throw factory.getSQLExceptionHelper().convert(
View Full Code Here

    Type[] idTypes = new Type[ids.length];
    Arrays.fill( idTypes, type );
    try {
      doQueryAndInitializeNonLazyCollections(
          session,
          new QueryParameters( idTypes, ids, ids ),
          true
        );
    }
    catch ( SQLException sqle ) {
      throw factory.getSQLExceptionHelper().convert(
View Full Code Here

    Type[] idTypes = new Type[ids.length];
    Arrays.fill( idTypes, type );
    try {
      doQueryAndInitializeNonLazyCollections( session,
          new QueryParameters( parameterTypes, parameterValues, namedParameters, ids ),
          true
        );
    }
    catch ( SQLException sqle ) {
      throw factory.getSQLExceptionHelper().convert(
View Full Code Here

      if ( log.isDebugEnabled() ) {
        log.debugf( "Batch loading entity: %s", MessageHelper.infoString( persister(), idsToLoad, session.getFactory() ) );
      }

      QueryParameters qp = buildQueryParameters( id, idsToLoad, optionalObject, lockOptions );
      List results = dynamicLoader.doEntityBatchFetch( session, qp, idsToLoad );
      return getObjectFromList( results, id, session );
    }
View Full Code Here

  }
 
  public ScrollableResults scroll(SessionImplementor session, ScrollMode scrollMode)
  throws HibernateException {
    QueryParameters qp = translator.getQueryParameters();
    qp.setScrollMode(scrollMode);
    return scroll(qp, resultTypes, null, session);
  }
View Full Code Here

    final QueryNode query = (QueryNode) sqlAst;
    final boolean hasLimit = queryParameters.getRowSelection() != null && queryParameters.getRowSelection().definesLimits();
    final boolean needsDistincting = ( query.getSelectClause().isDistinct() || hasLimit ) && containsCollectionFetches();

    QueryParameters queryParametersToUse;
    if ( hasLimit && containsCollectionFetches() ) {
      LOG.firstOrMaxResultsSpecifiedWithCollectionFetch();
      RowSelection selection = new RowSelection();
      selection.setFetchSize( queryParameters.getRowSelection().getFetchSize() );
      selection.setTimeout( queryParameters.getRowSelection().getTimeout() );
View Full Code Here

    final boolean hasLimit = queryParameters.getRowSelection() != null
        && queryParameters.getRowSelection().definesLimits();
    final boolean needsLimit = hasLimit && translators.length > 1;

    final QueryParameters queryParametersToUse;
    if ( needsLimit ) {
      LOG.needsLimit();
      final RowSelection selection = new RowSelection();
      selection.setFetchSize( queryParameters.getRowSelection().getFetchSize() );
      selection.setTimeout( queryParameters.getRowSelection().getTimeout() );
View Full Code Here

TOP

Related Classes of org.hibernate.engine.spi.QueryParameters

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.