Package org.hibernate.engine.spi

Examples of org.hibernate.engine.spi.NamedQueryDefinitionBuilder


        .setQueryReturns( nativeSqlQuery.getQueryReturns() );
    return builder.createNamedQueryDefinition();
  }

  private NamedQueryDefinition extractHqlQueryDefinition(org.hibernate.Query hqlQuery, String name) {
    final NamedQueryDefinitionBuilder builder = new NamedQueryDefinitionBuilder( name );
    fillInNamedQueryBuilder( builder, hqlQuery );
    // LockOptions only valid for HQL/JPQL queries...
    builder.setLockOptions( hqlQuery.getLockOptions().makeCopy() );
    return builder.createNamedQueryDefinition();
  }
View Full Code Here


        .setQueryReturns( nativeSqlQuery.getQueryReturns() );
    return builder.createNamedQueryDefinition();
  }

  private NamedQueryDefinition extractHqlQueryDefinition(org.hibernate.Query hqlQuery, String name) {
    final NamedQueryDefinitionBuilder builder = new NamedQueryDefinitionBuilder( name );
    fillInNamedQueryBuilder( builder, hqlQuery );
    // LockOptions only valid for HQL/JPQL queries...
    builder.setLockOptions( hqlQuery.getLockOptions().makeCopy() );
    return builder.createNamedQueryDefinition();
  }
View Full Code Here

    Attribute cacheModeAtt = queryElem.attribute( "cache-mode" );
    String cacheMode = cacheModeAtt == null ? null : cacheModeAtt.getValue();
    Attribute cmAtt = queryElem.attribute( "comment" );
    String comment = cmAtt == null ? null : cmAtt.getValue();

    NamedQueryDefinition namedQuery = new NamedQueryDefinitionBuilder().setName( queryName )
        .setQuery( query )
        .setCacheable( cacheable )
        .setCacheRegion( region )
        .setTimeout( timeout )
        .setFetchSize( fetchSize )
View Full Code Here

      throw new AnnotationException( "A named query must have a name when used in class or package level" );
    }
    //EJBQL Query
    QueryHintDefinition hints = new QueryHintDefinition( queryAnn.hints() );
    String queryName = queryAnn.query();
    NamedQueryDefinition queryDefinition = new NamedQueryDefinitionBuilder( queryAnn.name() )
        .setLockOptions( hints.determineLockOptions( queryAnn ) )
        .setQuery( queryName )
        .setCacheable( hints.getBoolean( queryName, QueryHints.CACHEABLE ) )
        .setCacheRegion( hints.getString( queryName, QueryHints.CACHE_REGION ) )
        .setTimeout( hints.getTimeout( queryName ) )
View Full Code Here

      throw new AnnotationException( "A named query must have a name when used in class or package level" );
    }
    FlushMode flushMode;
    flushMode = getFlushMode( queryAnn.flushMode() );

    NamedQueryDefinition query = new NamedQueryDefinitionBuilder().setName( queryAnn.name() )
        .setQuery( queryAnn.query() )
        .setCacheable( queryAnn.cacheable() )
        .setCacheRegion(
            BinderHelper.isEmptyAnnotationValue( queryAnn.cacheRegion() ) ?
                null :
View Full Code Here

    if ( StringHelper.isEmpty( comment ) ) {
      comment = null;
    }

    metadata.addNamedQuery(
        new NamedQueryDefinitionBuilder().setName( name ).setQuery( query ).setCacheable(
            getBoolean(
                hints,
                QueryHints.CACHEABLE,
                name
            )
View Full Code Here

        .setQueryReturns( nativeSqlQuery.getQueryReturns() );
    return builder.createNamedQueryDefinition();
  }

  private NamedQueryDefinition extractHqlQueryDefinition(org.hibernate.Query hqlQuery, String name) {
    final NamedQueryDefinitionBuilder builder = new NamedQueryDefinitionBuilder( name );
    fillInNamedQueryBuilder( builder, hqlQuery );
    // LockOptions only valid for HQL/JPQL queries...
    builder.setLockOptions( hqlQuery.getLockOptions().makeCopy() );
    return builder.createNamedQueryDefinition();
  }
View Full Code Here

        .setQueryReturns( nativeSqlQuery.getQueryReturns() );
    return builder.createNamedQueryDefinition();
  }

  private NamedQueryDefinition extractHqlQueryDefinition(org.hibernate.Query hqlQuery, String name) {
    final NamedQueryDefinitionBuilder builder = new NamedQueryDefinitionBuilder( name );
    fillInNamedQueryBuilder( builder, hqlQuery );
    // LockOptions only valid for HQL/JPQL queries...
    builder.setLockOptions( hqlQuery.getLockOptions().makeCopy() );
    return builder.createNamedQueryDefinition();
  }
View Full Code Here

    Attribute cacheModeAtt = queryElem.attribute( "cache-mode" );
    String cacheMode = cacheModeAtt == null ? null : cacheModeAtt.getValue();
    Attribute cmAtt = queryElem.attribute( "comment" );
    String comment = cmAtt == null ? null : cmAtt.getValue();

    NamedQueryDefinition namedQuery = new NamedQueryDefinitionBuilder().setName( queryName )
        .setQuery( query )
        .setCacheable( cacheable )
        .setCacheRegion( region )
        .setTimeout( timeout )
        .setFetchSize( fetchSize )
View Full Code Here

        .setQueryReturns( nativeSqlQuery.getQueryReturns() );
    return builder.createNamedQueryDefinition();
  }

  private NamedQueryDefinition extractHqlQueryDefinition(org.hibernate.Query hqlQuery, String name) {
    final NamedQueryDefinitionBuilder builder = new NamedQueryDefinitionBuilder( name );
    fillInNamedQueryBuilder( builder, hqlQuery );
    // LockOptions only valid for HQL/JPQL queries...
    builder.setLockOptions( hqlQuery.getLockOptions().makeCopy() );
    return builder.createNamedQueryDefinition();
  }
View Full Code Here

TOP

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

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.