Hi, I'm trying to implement the Second Level cache, but I'm having some trouble when getting to the hibernate mapping...
I have inserted this line in my configuraiton file:
Code:
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
and in my hibernate mapping file I inserted the cache tag as follows:
Code:
<class name="Agency">
<cache usage="read-write"/>
<id name="code" type="long" column="code" unsaved-value="null">
<generator class="native"/>
</id>
<property name="ord" type="long"/>
<property name="name" type="string"/>
<property name="ident" type="string"/>
<property name="hotelCanFee" type="boolean"/>
<property name="canHaveSubAllotment" type="boolean"/>
<many-to-one name="postalAddress" class="PostalAddress" column="postalAddress"/>
<many-to-one name="contactPerson" class="Person" column="contactPerson"/>
<property name="logo" type="string"/>
<many-to-one name="country" class="Country" column="country"/>
<many-to-one name="language" class="Language" column="language"/>
<many-to-one name="currency" class="Currency" column="currency"/>
<property name="handlingFee" type="long"/>
<property name="cancelDeadlinePlus" type="long"/>
<set name="branchOffices" inverse="true" lazy="true" order-by="code" cascade="all">
<cache usage="read-write"/>
<key column="agency"/>
<one-to-many class="BranchOffice"/>
</set>
</class>
So, when compiling I get this error:
Code:
org.xml.sax.SAXParseException: Element type "cache" must be declared.
What I'm doing wrong?
Thank you very much!