Hi all,

Letâs say we have an object name Father, who has a Child class collection 
(aggregate association). With the right repository settings (autoretrieve= 
true etc.) every time we "load" a father from the database, the children 
will be instantiated (they may be proxies or materialized).

Hereâs our ignorance: when we retrieve a father we need the retrieved 
children collection, to be just a subset of the all fatherâs children 
collection. The children are those with a any given attribute set to a any 
given value (let say just those children with gender attribute set to 
female).

This is just like having a filter or criteria setting at the owned 
collection level.
Please pay attention to the fact we do not want to filter the fathers 
based in some children attributes. We need retrieve all fathers, just 
filtering some children.

We are aware we could retrieve the father an then iterate the collection 
discarding the children we do not need, but we need this to become a 
common feature for our classes, not just a business logic for a single 
app, therefore we would like to know how to handle this in general.


Thanks in advance,
Gustavo Faerman.

Buenos Aires, Argentina

Reply via email to