| java.lang.Object org.apache.ojb.broker.accesslayer.BasePrefetcher org.apache.ojb.broker.accesslayer.RelationshipPrefetcherImpl org.apache.ojb.broker.accesslayer.CollectionPrefetcher org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher
MtoNCollectionPrefetcher | public class MtoNCollectionPrefetcher extends CollectionPrefetcher (Code) | | Relationship Prefetcher for MtoN-Collections.
author: Jakob Braeuchi version: $Id: MtoNCollectionPrefetcher.java,v 1.12.2.7 2005/12/21 22:22:58 tomdz Exp $ |
associateBatched | protected void associateBatched(Collection owners, Collection children, Collection mToNImplementors)(Code) | | associate the batched Children with their owner object loop over children
BRJ: There is a potential problem with the type of the pks used to build the Identities.
When creating an Identity for the owner, the type of pk is defined by the instvars
representing the pk. When creating the Identity based on the mToNImplementor the
type of the pk is defined by the jdbc-type of field-descriptor of the referenced class.
This type mismatch results in Identities not being equal.
Integer[] {10,20,30} is not equal Long[] {10,20,30}
This problem is documented in defect OJB296.
The conversion of the keys of the mToNImplementor should solve this problem.
|
buildMtoNImplementorQueries | protected Query[] buildMtoNImplementorQueries(Collection owners, Collection children)(Code) | | Build the multiple queries for one relationship because of limitation of IN(...)
Parameters: owners - Collection containing all objects of the ONE side |
buildMtoNImplementorQuery | protected Query buildMtoNImplementorQuery(Collection ids)(Code) | | Build a query to read the mn-implementors
Parameters: ids - |
buildPrefetchQuery | protected Query buildPrefetchQuery(Collection ids)(Code) | | Build the prefetch query for a M-N relationship, The query looks like the following sample :
crit = new Criteria();
crit.addIn("PERSON_PROJECT.PROJECT_ID", ids);
crit.addEqualToField("id","PERSON_PROJECT.PERSON_ID");
qry = new QueryByMtoNCriteria(Person.class, "PERSON_PROJECT", crit, true);
Parameters: ids - Collection containing all identities of objects of the M side the prefetch Query |
|
|