Hi All,

What I have :
Root Object RO has:
 - a collection of CO objects specified using <collection-descriptor>

Child Object CO has:
 - a collection of CO objects specified using <collection-descriptor>
 - a reference to a parent CO (null if the object has no CO parent)
 - a reference to the RO

Example...

RO
  + CO
     + CO
        + CO
        + CO
     + CO
     + CO
  + CO
  + CO
  
However, when my collection of CO's for the RO is built by OJB on
retrieval, it does something like:
   SELECT * FROM co WHERE co.RO_reference = RO.id
This returns all the CO objects, but I only want the direct children
such as:
   SELECT * FROM co WHERE (co.RO_reference = RO.id) AND (co.CO_parent =
null)

Which I would ideally declare something like:

<collection descriptor name="COTree"
        element-class-ref="CO"
        auto-retrieve="true"
        auto-update="false"
        >
        <inverse-foreignkey field-ref="RO_reference"/>
        <inverse-criteria field-ref="CO_parent" value="null"/>
</collection-descriptor>

I searched the mail archives and came up with some posts saying that
qualified relationships were on the todo list in February 2003... Has
there been any progress since then? 

Alternatively, how have other people solved this? Setting auto-retrieve
to false and doing a getCollectionByCriteria() in the
PersistenceBrokerAware afterLookup() method seems like a reasonable
option, but means the business object layer starts to know a little bit
much about the persistence mechanisms...

Thanks for your help,

Robert Coup :)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to