org.apache.ojb.broker.accesslayer
Class BasePrefetcher

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

public abstract class BasePrefetcher
extends java.lang.Object
implements RelationshipPrefetcher

Abstract Prefetcher.

Version:
$Id: BasePrefetcher.java,v 1.5 2004/01/15 20:58:46 brj Exp $
Author:
Oleg Nitz

Field Summary
protected static int IN_LIMIT
           
protected  ClassDescriptor itemClassDesc
           
protected  int pkLimit
           
 
Constructor Summary
BasePrefetcher(PersistenceBroker aBroker, java.lang.Class anItemClass)
          Constructor for BasePrefetcher.
 
Method Summary
protected abstract  void associateBatched(java.util.Collection owners, java.util.Collection children)
          associate the batched Children with their owner object
protected  Criteria buildPrefetchCriteria(java.util.Collection ids, FieldDescriptor[] fields)
           
protected abstract  Query[] buildPrefetchQueries(java.util.Collection owners, java.util.Collection children)
           
protected  QueryByCriteria buildPrefetchQuery(java.lang.Class clazz, java.util.Collection ids, FieldDescriptor[] fields)
           
protected  QueryByCriteria buildPrefetchQuery(java.util.Collection ids, FieldDescriptor[] fields)
           
protected  PersistenceBroker 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(java.util.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

itemClassDesc

protected ClassDescriptor itemClassDesc

pkLimit

protected final int pkLimit

IN_LIMIT

protected static final int IN_LIMIT
Constructor Detail

BasePrefetcher

public BasePrefetcher(PersistenceBroker aBroker,
                      java.lang.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(java.util.Collection owners,
                                         java.util.Collection children)
associate the batched Children with their owner object


prefetchRelationship

public void prefetchRelationship(java.util.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(java.util.Collection ids,
                                             FieldDescriptor[] fields)

buildPrefetchCriteria

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

buildPrefetchQuery

protected QueryByCriteria buildPrefetchQuery(java.lang.Class clazz,
                                             java.util.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(java.util.Collection owners,
                                                java.util.Collection children)

getBroker

protected PersistenceBroker getBroker()
Returns the broker.

Returns:
PersistenceBroker

getLogger

protected Logger getLogger()
Returns the logger.

Returns:
Logger


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