Hi Sebastian,

if the "one particular Child object" is based on information of the parent object or the filter attributes are static you can try to use custom collection queries

http://db.apache.org/ojb/tutorial3.html#Customizing%20collection%20queries

> Btw. OJB is configured to use a foreign key with anonymous access to
> reference the Parent object.

please be careful in using anonymous keys outside of a 1:1 reference. Here is the section in new upcoming documentation (beta-version)

http://www.powaibel.de/ojb/ojb-style/docu/advanced-technique.html#How+do+

regards,
Armin


Sebastian wrote:

I have the following 2 classes:

class Child
{
   private Parent P;
   private String ref;
}

class Parent
{

}

[Child] n<-1 [Parent]

Now somehow I retrieve an object of Parent and want to get the corresponding Child object with a certain value in the ref field.

I know that I could create a reference collection property in the repository file for class Parent. I want to avoid this to save memory and db calls since I'm only interested in one particular Child object and not in all Child objects that belong to Parent.

How can I do this?

Btw. OJB is configured to use a foreign key with anonymous access to reference the Parent object.


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




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



Reply via email to