org.apache.ojb.broker.accesslayer
Class CollectionPrefetcher

java.lang.Object
  extended byorg.apache.ojb.broker.accesslayer.BasePrefetcher
      extended byorg.apache.ojb.broker.accesslayer.RelationshipPrefetcherImpl
          extended byorg.apache.ojb.broker.accesslayer.CollectionPrefetcher
All Implemented Interfaces:
RelationshipPrefetcher
Direct Known Subclasses:
MtoNCollectionPrefetcher

public class CollectionPrefetcher
extends RelationshipPrefetcherImpl

Relationship Prefetcher for Collections.

Version:
$Id: CollectionPrefetcher.java,v 1.22 2004/01/15 20:58:46 brj Exp $
Author:
Jakob Braeuchi

Field Summary
 
Fields inherited from class org.apache.ojb.broker.accesslayer.BasePrefetcher
IN_LIMIT, itemClassDesc, pkLimit
 
Constructor Summary
CollectionPrefetcher(PersistenceBroker aBroker, ObjectReferenceDescriptor anOrd)
          Constructor for CollectionPrefetcher.
 
Method Summary
protected  void associateBatched(java.util.Collection owners, java.util.Collection children)
          associate the batched Children with their owner object loop over children
protected  Query[] buildPrefetchQueries(java.util.Collection owners, java.util.Collection children)
          Build the multiple queries for one relationship because of limitation of IN(...)
protected  Query buildPrefetchQuery(java.util.Collection ids)
          Build the query to perform a batched read get orderBy settings from CollectionDescriptor
protected  ManageableCollection createCollection(java.lang.Class collectionClass)
          Create a Collection of class collectionClass if collectionClass is null return a RemovalAwareCollection
protected  CollectionDescriptor getCollectionDescriptor()
           
 
Methods inherited from class org.apache.ojb.broker.accesslayer.RelationshipPrefetcherImpl
getObjectReferenceDescriptor, getOwnerClassDescriptor, isCascadeRetrieve, prepareRelationshipSettings, restoreRelationshipSettings, setCascadeRetrieve, setObjectReferenceDescriptor
 
Methods inherited from class org.apache.ojb.broker.accesslayer.BasePrefetcher
buildPrefetchCriteria, buildPrefetchQuery, buildPrefetchQuery, getBroker, getDescriptorRepository, getItemClassDescriptor, getLimit, getLogger, prefetchRelationship
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionPrefetcher

public CollectionPrefetcher(PersistenceBroker aBroker,
                            ObjectReferenceDescriptor anOrd)
Constructor for CollectionPrefetcher.

Parameters:
aBroker -
anOrd -
Method Detail

buildPrefetchQueries

protected Query[] buildPrefetchQueries(java.util.Collection owners,
                                       java.util.Collection children)
Build the multiple queries for one relationship because of limitation of IN(...)

Specified by:
buildPrefetchQueries in class BasePrefetcher
Parameters:
owners - Collection containing all objects of the ONE side

buildPrefetchQuery

protected Query buildPrefetchQuery(java.util.Collection ids)
Build the query to perform a batched read get orderBy settings from CollectionDescriptor

Parameters:
ids - Collection containing all identities of objects of the ONE side

associateBatched

protected void associateBatched(java.util.Collection owners,
                                java.util.Collection children)
associate the batched Children with their owner object loop over children

Specified by:
associateBatched in class BasePrefetcher

createCollection

protected ManageableCollection createCollection(java.lang.Class collectionClass)
Create a Collection of class collectionClass if collectionClass is null return a RemovalAwareCollection

Parameters:
collectionClass -
Returns:

getCollectionDescriptor

protected CollectionDescriptor getCollectionDescriptor()


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14