You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Michael Newton <mi...@gmail.com> on 2005/02/10 21:36:46 UTC

OJB collections not getting cached

My apps has Domains that have a m:n relationship with Groups (although
I only need to navigate from Domains to Groups). I am successfully
using a collection-descriptor with an indirection table to do this. My
problem is that this "memberships" collection is not being persisted
as part of the Domain object. The memberships are there when the
Domain is first fetched from the database, but when I cache it (to
disk with OSCache, if that matters) and then retrieve it,  memberships
is null.

I want a Domain to persist with references to its Groups - isn't that
possible? Or do I have to make a Membership class and cache that too?

Here's my setup right now:

<class-descriptor
	class="legion.service.Domain"
	table="domain"
	>

	...

  <collection-descriptor
     name="memberships"
     element-class-ref="legion.service.Group"
    collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList"
     auto-retrieve="true"
     auto-update="false"
     indirection-table="domain_group"
	>
     <fk-pointing-to-this-class column="domain_id"/>
     <fk-pointing-to-element-class column="group_id"/>
  </collection-descriptor>
 
</class-descriptor>

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org