org.apache.ojb.broker.accesslayer
Class CollectionPrefetcher

java.lang.Object
  extended by org.apache.ojb.broker.accesslayer.BasePrefetcher
      extended by org.apache.ojb.broker.accesslayer.RelationshipPrefetcherImpl
          extended by org.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.1 2007-08-24 22:17:30 ewestfal Exp $
Author:
Jakob Braeuchi

Field Summary
 
Fields inherited from class org.apache.ojb.broker.accesslayer.BasePrefetcher
IN_LIMIT, itemClassDesc, pkLimit
 
Constructor Summary
CollectionPrefetcher(PersistenceBrokerImpl aBroker, ObjectReferenceDescriptor anOrd)
          Constructor for CollectionPrefetcher.
 
Method Summary
protected  void associateBatched(Collection owners, Collection children)
          associate the batched Children with their owner object loop over children
protected  Query[] buildPrefetchQueries(Collection owners, Collection children)
          Build the multiple queries for one relationship because of limitation of IN(...)
protected  Query buildPrefetchQuery(Collection ids)
          Build the query to perform a batched read get orderBy settings from CollectionDescriptor
protected  ManageableCollection createCollection(CollectionDescriptor desc, Class collectionClass)
          Create a collection object of the given collection type.
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(PersistenceBrokerImpl aBroker,
                            ObjectReferenceDescriptor anOrd)
Constructor for CollectionPrefetcher.

Parameters:
aBroker -
anOrd -
Method Detail

buildPrefetchQueries

protected Query[] buildPrefetchQueries(Collection owners,
                                       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(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(Collection owners,
                                Collection children)
associate the batched Children with their owner object loop over children

Specified by:
associateBatched in class BasePrefetcher

createCollection

protected ManageableCollection createCollection(CollectionDescriptor desc,
                                                Class collectionClass)
Create a collection object of the given collection type. If none has been given, OJB uses RemovalAwareList, RemovalAwareSet, or RemovalAwareCollection depending on the field type.

Parameters:
desc - The collection descriptor
collectionClass - The collection class specified in the collection-descriptor
Returns:
The collection object

getCollectionDescriptor

protected CollectionDescriptor getCollectionDescriptor()


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.