org.apache.ojb.broker.accesslayer
Class BasePrefetcher

java.lang.Object
  extended by org.apache.ojb.broker.accesslayer.BasePrefetcher
All Implemented Interfaces:
RelationshipPrefetcher
Direct Known Subclasses:
PlainPrefetcher, RelationshipPrefetcherImpl

public abstract class BasePrefetcher
extends Object
implements RelationshipPrefetcher

Abstract Prefetcher.

Version:
$Id: BasePrefetcher.java,v 1.1 2007-08-24 22:17:30 ewestfal Exp $
Author:
Oleg Nitz

Field Summary
protected static int IN_LIMIT
          The numer of columns to query for.
protected  ClassDescriptor itemClassDesc
          Class descriptor for the item type.
protected  int pkLimit
          Maximum number of pk's in one query.
 
Constructor Summary
BasePrefetcher(PersistenceBrokerImpl aBroker, Class anItemClass)
          Constructor for BasePrefetcher.
 
Method Summary
protected abstract  void associateBatched(Collection owners, Collection children)
          associate the batched Children with their owner object
protected  Criteria buildPrefetchCriteria(Collection ids, FieldDescriptor[] fields)
           
protected abstract  Query[] buildPrefetchQueries(Collection owners, Collection children)
           
protected  QueryByCriteria buildPrefetchQuery(Class clazz, Collection ids, FieldDescriptor[] fields)
           
protected  QueryByCriteria buildPrefetchQuery(Collection ids, FieldDescriptor[] fields)
           
protected  PersistenceBrokerImpl getBroker()
          Returns the broker.
protected  DescriptorRepository getDescriptorRepository()
          Return the DescriptorRepository
 ClassDescriptor getItemClassDescriptor()
          Returns the ClassDescriptor of the item Class
 int getLimit()
          The limit of objects loaded by one SQL query
protected  Logger getLogger()
          Returns the logger.
 void prefetchRelationship(Collection owners)
          Prefetch the Relationship for the owners (the 1 side of a 1:n)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ojb.broker.accesslayer.RelationshipPrefetcher
prepareRelationshipSettings, restoreRelationshipSettings
 

Field Detail

IN_LIMIT

protected static final int IN_LIMIT
The numer of columns to query for.


itemClassDesc

protected ClassDescriptor itemClassDesc
Class descriptor for the item type.


pkLimit

protected final int pkLimit
Maximum number of pk's in one query.

Constructor Detail

BasePrefetcher

public BasePrefetcher(PersistenceBrokerImpl aBroker,
                      Class anItemClass)
Constructor for BasePrefetcher.

Method Detail

getLimit

public int getLimit()
The limit of objects loaded by one SQL query

Specified by:
getLimit in interface RelationshipPrefetcher

associateBatched

protected abstract void associateBatched(Collection owners,
                                         Collection children)
associate the batched Children with their owner object


prefetchRelationship

public void prefetchRelationship(Collection owners)
Description copied from interface: RelationshipPrefetcher
Prefetch the Relationship for the owners (the 1 side of a 1:n)

Specified by:
prefetchRelationship in interface RelationshipPrefetcher
See Also:
RelationshipPrefetcher.prefetchRelationship(Collection)

buildPrefetchQuery

protected QueryByCriteria buildPrefetchQuery(Collection ids,
                                             FieldDescriptor[] fields)

buildPrefetchCriteria

protected Criteria buildPrefetchCriteria(Collection ids,
                                         FieldDescriptor[] fields)
Parameters:
ids - collection of identities
fields -
Returns:

buildPrefetchQuery

protected QueryByCriteria buildPrefetchQuery(Class clazz,
                                             Collection ids,
                                             FieldDescriptor[] fields)
Parameters:
clazz -
ids - collection of identities
fields -
Returns:

getDescriptorRepository

protected DescriptorRepository getDescriptorRepository()
Return the DescriptorRepository


getItemClassDescriptor

public ClassDescriptor getItemClassDescriptor()
Returns the ClassDescriptor of the item Class

Specified by:
getItemClassDescriptor in interface RelationshipPrefetcher
Returns:
ClassDescriptor

buildPrefetchQueries

protected abstract Query[] buildPrefetchQueries(Collection owners,
                                                Collection children)

getBroker

protected PersistenceBrokerImpl getBroker()
Returns the broker.

Returns:
PersistenceBrokerImpl

getLogger

protected Logger getLogger()
Returns the logger.

Returns:
Logger


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