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

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

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

Ehcache.getSearchAttribute介绍

[英]Retrieve the given named search attribute
[中]检索给定的命名搜索属性

代码示例

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

/**
 * {@inheritDoc}
 */
public <T> Attribute<T> getSearchAttribute(String attributeName) throws CacheException {
  return underlyingCache.getSearchAttribute(attributeName);
}

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

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

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

/**
 * {@inheritDoc}
 */
public <T> Attribute<T> getSearchAttribute(String attributeName) throws CacheException {
  return underlyingCache.getSearchAttribute(attributeName);
}

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

/**
 * {@inheritDoc}
 */
public <T> Attribute<T> getSearchAttribute(String attributeName) throws CacheException {
  return underlyingCache.getSearchAttribute(attributeName);
}

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

/**
 * {@inheritDoc}
 */
public <T> Attribute<T> getSearchAttribute(String attributeName) throws CacheException {
  return underlyingCache.getSearchAttribute(attributeName);
}

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

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

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

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

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

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

代码示例来源: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;
}

相关文章

微信公众号

最新文章

更多

Ehcache类方法