Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.1
Mapping documents: tempclass.xml
<class name="tempclass" table="field_option_value" batch-size="10">
<composite-id name="comp_id" class="tempclassPK">
<key-property name="id" column="option_id" type="int"/>
<key-property name="value" column="value_txt" type="string"/>
</composite-id>
<property name="displayOrderNum" type="java.lang.Integer" column="display_order_num" />
<property name="description" type="string" column="value_desc" not-null="true" length="100"/>
<many-to-one name="listName" class="tempColl" column="option_id" insert="false" update="false"/>
</class>
added
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.OSCacheProvider</property>
<property name="hibernate.cache.use_query_cache">true</property> in config file.
Code between sessionFactory.openSession() and session.close():
Code:
Query query = getSession().createQuery("from tempclass as item " + "where item.listName.name = :listName order by item.displayOrderNum");
query.setCacheable(true);
query.setString("listName", listName);
items = query.list();
Full stack trace of any exception that occurs: Code:
net/sf/hibernate/cache/ReadWriteCache$Item incompatible with net/sf/hibernate/impl/CacheEntry
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.Throwable.<init>(Throwable.java)
The cause for this exception is ClassCastException
[/code]