首页 > 解决方案 > I have to show the all values in lookup tables values as dropdown in UI I am using hibernate session query and I am storing in cache

问题描述

But the cache is not storing values its querying each Tuple(line) of database which is even worse than implementing cache I have done this steps

  1. Marking entity as @Cachable and @Cache(read only , my region)
  2. and session(set Cachable = true)
  3. In hibernate configuration I have set use query cache= true
  4. I am using ehcache

I want all the my POJO objects from the database table using cache someone please help me Thanks in advance

标签: javahibernatehibernate-criteria

解决方案


这可能是由多种原因引起的,首先,您是否在配置 XML 文件中配置查询缓存(女巫是纯 Hibernate 项目中的 hibernate.cfg.xml 或 JPA 项目中的 persistence.xml)


推荐阅读