org.hibernate.query.Query.setCacheRegion()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中org.hibernate.query.Query.setCacheRegion方法的一些代码示例,展示了Query.setCacheRegion的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setCacheRegion方法的具体详情如下:
包路径:org.hibernate.query.Query
类名称:Query
方法名:setCacheRegion

Query.setCacheRegion介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

protected void setQueryProperties(Query query) {
  if ( maxResults != null ) {
    query.setMaxResults( maxResults );
  }
  if ( firstResult != null ) {
    query.setFirstResult( firstResult );
  }
  if ( cacheable != null ) {
    query.setCacheable( cacheable );
  }
  if ( cacheRegion != null ) {
    query.setCacheRegion( cacheRegion );
  }
  if ( comment != null ) {
    query.setComment( comment );
  }
  if ( flushMode != null ) {
    query.setFlushMode( flushMode );
  }
  if ( cacheMode != null ) {
    query.setCacheMode( cacheMode );
  }
  if ( timeout != null ) {
    query.setTimeout( timeout );
  }
  if ( lockOptions != null && lockOptions.getLockMode() != LockMode.NONE ) {
    query.setLockMode( REFERENCED_ENTITY_ALIAS, lockOptions.getLockMode() );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

.setParameter( "id", 0L)
.setCacheable(true)
.setCacheRegion( "query.cache.person" )
.list();
.setParameter( "id", 0L)
.setCacheable(true)
.setCacheRegion( "query.cache.person" )
.setCacheMode( CacheMode.REFRESH )
.list();

代码示例来源:origin: hibernate/hibernate-orm

protected void initQueryFromNamedDefinition(Query query, NamedQueryDefinition nqd) {
  // todo : cacheable and readonly should be Boolean rather than boolean...
  query.setCacheable( nqd.isCacheable() );
  query.setCacheRegion( nqd.getCacheRegion() );
  query.setReadOnly( nqd.isReadOnly() );
  if ( nqd.getTimeout() != null ) {
    query.setTimeout( nqd.getTimeout() );
  }
  if ( nqd.getFetchSize() != null ) {
    query.setFetchSize( nqd.getFetchSize() );
  }
  if ( nqd.getCacheMode() != null ) {
    query.setCacheMode( nqd.getCacheMode() );
  }
  if ( nqd.getComment() != null ) {
    query.setComment( nqd.getComment() );
  }
  if ( nqd.getFirstResult() != null ) {
    query.setFirstResult( nqd.getFirstResult() );
  }
  if ( nqd.getMaxResults() != null ) {
    query.setMaxResults( nqd.getMaxResults() );
  }
  if ( nqd.getFlushMode() != null ) {
    query.setHibernateFlushMode( nqd.getFlushMode() );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

session -> session.createQuery( queryString ).setCacheable( true ).setCacheRegion( queryCacheRegionName ).list()
);

代码示例来源:origin: com.atlassian.hibernate/hibernate.adapter

@Override
public Query setCacheRegion(final String cacheRegion) {
  if (queryV2ForCompare != null) {
    queryV2ForCompare.setCacheRegion(cacheRegion);
  }
  query.setCacheRegion(cacheRegion);
  return this;
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

query.setCacheRegion( cacheRegion );

相关文章