Hello,
I just finished reading caching strategies in the HIA book, and I would like to centralize all the cache info in a single file. In a standalone configuration I would do this within hibernate.cfg.xml file.
So for the caveatemptor app I would have:
<hibernate-configuration>
<session-factory>
--mappings--
<!-- Caching -->
<class-cache
class="org.hibernate.auction.model.Category"
region="org/hibernate/auction/model/Category"
usage="read-write"/>
<class-cache
class="org.hibernate.auction.model.Item"
region="org/hibernate/auction/model/Item"
usage="transactional"/>
<class-cache
class="org.hibernate.auction.model.Bid"
region="org/hibernate/auction/model/Bid"
usage="read-only"/>
</session-factory>
</hibernate-configuration>
How do I configure the same thing but within hibernate-service.xml or better said when hibernate is configured as a service.
I know I can include caching in the mapping files, but I am interested in a centralized location.
Thanks.
|