[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ojb-user
Subject:    OJB collections not getting cached
From:       Michael Newton <michael.newton () gmail ! com>
Date:       2005-02-10 20:36:46
Message-ID: aeb0cacb05021012365b96585b () mail ! gmail ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic