net.sf.ehcache.Ehcache.createQuery()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(157)

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

Ehcache.createQuery介绍

[英]Create a new query builder for this cache
[中]为此缓存创建新的查询生成器

代码示例

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * {@inheritDoc}
 */
public Query createQuery() {
  return underlyingCache.createQuery();
}

代码示例来源:origin: net.sf.ehcache/ehcache

/**
* {@inheritDoc}
*/
public Query createQuery() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.createQuery();
  } finally {
    t.setContextClassLoader(prev);
  }
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * {@inheritDoc}
 */
public Query createQuery() {
  return underlyingCache.createQuery();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
 * {@inheritDoc}
 */
public Query createQuery() {
  return underlyingCache.createQuery();
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * {@inheritDoc}
 */
public Query createQuery() {
  return underlyingCache.createQuery();
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
* {@inheritDoc}
*/
public Query createQuery() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.createQuery();
  } finally {
    t.setContextClassLoader(prev);
  }
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
* {@inheritDoc}
*/
public Query createQuery() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.createQuery();
  } finally {
    t.setContextClassLoader(prev);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
* {@inheritDoc}
*/
public Query createQuery() {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    return this.cache.createQuery();
  } finally {
    t.setContextClassLoader(prev);
  }
}

代码示例来源:origin: net.sf.ehcache/ehcache

ClassLoader loader = ehcache.getCacheConfiguration().getClassLoader();        
Query q = ehcache.createQuery();

代码示例来源:origin: org.pageseeder.bridge/pso-bridge

/**
 * Retrieve the object in the cache for the specified key.
 *
 * @param id The ID of the PageSeeder entity in the PageSeeder database.
 *
 * @return The version of the element or <code>null</code> if the key or element is <code>null</code>
 */
@Override
@SuppressWarnings("unchecked")
public synchronized @Nullable E get(Long id) {
 if (id == null)
  return null;
 @Nullable E o = null;
 Query query =  this._cache.createQuery();
 Attribute<Long> byId = this._cache.getSearchAttribute("id");
 query.includeValues().addCriteria(byId.eq(id));
 Results results = query.execute();
 List<Result> all = results.all();
 if (all.size() > 0) {
  Result r = all.get(0);
  o = (E)r.getValue();
 }
 return o;
}

代码示例来源:origin: org.pageseeder.bridge/pso-bridge

/**
 * Retrieve the object in the cache for the specified key.
 *
 * @param attribute The name of the attribute to match.
 * @param value       The value of the attribute to match.
 *
 * @return The list of matching element or <code>null</code> if the key or element is <code>null</code>
 */
@SuppressWarnings("unchecked")
public @Nullable List<E> list(String attribute, String value) {
 if (value == null)
  return null;
 Query query =  this._cache.createQuery();
 Attribute<String> byId = this._cache.getSearchAttribute(attribute);
 query.addCriteria(byId.eq(value));
 Results results = query.execute();
 List<Result> all = results.all();
 List<E> entities = new ArrayList<>();
 for (Result r : all) {
  entities.add((E)r.getValue());
 }
 return entities;
}

代码示例来源:origin: org.pageseeder.bridge/pso-bridge

/**
 * Retrieve the object in the cache for the specified key.
 *
 * @param attribute The name of the attribute to match.
 * @param value     The value of the attribute to match.
 *
 * @return The version of the element or <code>null</code> if the key or element is <code>null</code>
 */
@SuppressWarnings("unchecked")
public @Nullable E get(String attribute, String value) {
 if (value == null)
  return null;
 @Nullable E o = null;
 Query query =  this._cache.createQuery();
 Attribute<String> byId = this._cache.getSearchAttribute(attribute);
 query.includeValues().addCriteria(byId.eq(value));
 Results results = query.execute();
 List<Result> all = results.all();
 if (all.size() > 0) {
  Result r = all.get(0);
  o = (E)r.getValue();
 }
 return o;
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

ClassLoader loader = ehcache.getCacheConfiguration().getClassLoader();        
Query q = ehcache.createQuery();

相关文章

Ehcache类方法