hibernate - Second level cache for entities with where clause -


i wondering hibernate second level cache works expected if put clause in hbm.xml class definition:

<hibernate-mapping>   <class name="com.clazzes.a" table="table_a"    mutable="false" where="xyz=5" >   <cache usage="read-only"/>   <id name="id"  />   ... 

will hibernate still put id key cache, or have enable query cache? e.g. when execute hql query from id=2 results in sql similar select * table_a id=2 , (xyz=5). if execute query twice, consider second level cache, or nevertheless execute sql twice?

yes, have enable query cache. per query setting, have enough control on it.


Comments