[jboss-user] [EJB 3.0] - Hibernate second level cache with manytomany relationships

angusm do-not-reply at jboss.com
Thu Jul 23 10:32:42 EDT 2009


I want to use the Hibernate Second level cache for Entity beans. It works fine with simple Entitys, but in the case of many to many relations (for example the 'Relationships' tutorial) it does not work. I think that, at a Hibernate level, there is an explanation here:
 http://www.javalobby.org/java/forums/t48846.html
But I can not see how to implement his suggestion at EJB3 level. 
I suppose that what I am looking for is an annotation equivalent of
  <many-to-one name="parent" column="parent_id" class="Person"/>
  |   <set name="children">
  |    <key column="parent_id"/>
  |    <cache usage="read-write"/>
  |    <one-to-many class="Person"/>
  |   </set>
  | 
Specifically the <cache usage="read-write"/> bit.

Can anyone help? Thanks?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4245582#4245582

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4245582



More information about the jboss-user mailing list