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

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

本文整理了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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. return underlyingCache.createQuery();
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.createQuery();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. return underlyingCache.createQuery();
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. return underlyingCache.createQuery();
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. return underlyingCache.createQuery();
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.createQuery();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.createQuery();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Query createQuery() {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. return this.cache.createQuery();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

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

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

  1. /**
  2. * Retrieve the object in the cache for the specified key.
  3. *
  4. * @param id The ID of the PageSeeder entity in the PageSeeder database.
  5. *
  6. * @return The version of the element or <code>null</code> if the key or element is <code>null</code>
  7. */
  8. @Override
  9. @SuppressWarnings("unchecked")
  10. public synchronized @Nullable E get(Long id) {
  11. if (id == null)
  12. return null;
  13. @Nullable E o = null;
  14. Query query = this._cache.createQuery();
  15. Attribute<Long> byId = this._cache.getSearchAttribute("id");
  16. query.includeValues().addCriteria(byId.eq(id));
  17. Results results = query.execute();
  18. List<Result> all = results.all();
  19. if (all.size() > 0) {
  20. Result r = all.get(0);
  21. o = (E)r.getValue();
  22. }
  23. return o;
  24. }

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

  1. /**
  2. * Retrieve the object in the cache for the specified key.
  3. *
  4. * @param attribute The name of the attribute to match.
  5. * @param value The value of the attribute to match.
  6. *
  7. * @return The list of matching element or <code>null</code> if the key or element is <code>null</code>
  8. */
  9. @SuppressWarnings("unchecked")
  10. public @Nullable List<E> list(String attribute, String value) {
  11. if (value == null)
  12. return null;
  13. Query query = this._cache.createQuery();
  14. Attribute<String> byId = this._cache.getSearchAttribute(attribute);
  15. query.addCriteria(byId.eq(value));
  16. Results results = query.execute();
  17. List<Result> all = results.all();
  18. List<E> entities = new ArrayList<>();
  19. for (Result r : all) {
  20. entities.add((E)r.getValue());
  21. }
  22. return entities;
  23. }

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

  1. /**
  2. * Retrieve the object in the cache for the specified key.
  3. *
  4. * @param attribute The name of the attribute to match.
  5. * @param value The value of the attribute to match.
  6. *
  7. * @return The version of the element or <code>null</code> if the key or element is <code>null</code>
  8. */
  9. @SuppressWarnings("unchecked")
  10. public @Nullable E get(String attribute, String value) {
  11. if (value == null)
  12. return null;
  13. @Nullable E o = null;
  14. Query query = this._cache.createQuery();
  15. Attribute<String> byId = this._cache.getSearchAttribute(attribute);
  16. query.includeValues().addCriteria(byId.eq(value));
  17. Results results = query.execute();
  18. List<Result> all = results.all();
  19. if (all.size() > 0) {
  20. Result r = all.get(0);
  21. o = (E)r.getValue();
  22. }
  23. return o;
  24. }

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

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

相关文章

Ehcache类方法