Project Wonder 5.0

er.extensions.eof
Class ERXBatchFetchUtilities

java.lang.Object
  extended by er.extensions.eof.ERXBatchFetchUtilities
Direct Known Subclasses:
ERXRecursiveBatchFetching

public class ERXBatchFetchUtilities
extends java.lang.Object

ERXBatchFetchUtilities provides a collection of methods to support efficiently batch fetching arbitrarily deep keypaths on EOs.

Author:
Lenny Marks (lenny@aps.org)

Constructor Summary
ERXBatchFetchUtilities()
           
 
Method Summary
static void batchFetch(com.webobjects.eocontrol.EOEnterpriseObject sourceObject, com.webobjects.foundation.NSArray keypaths, boolean skipFaultedSourceObjects)
          Shortcut for batch fetching a single source object
static void batchFetch(com.webobjects.foundation.NSArray<? extends com.webobjects.eocontrol.EOEnterpriseObject> sourceObjects, ERXKey<?>... keys)
          Batch key the list of keys from the given source objects.
static void batchFetch(com.webobjects.foundation.NSArray sourceObjects, com.webobjects.foundation.NSArray keypaths)
          Defaults skipFaultedSourceObjects to false for backwards compatibility
static void batchFetch(com.webobjects.foundation.NSArray sourceObjects, com.webobjects.foundation.NSArray keypaths, boolean skipFaultedSourceObjects)
          Batch fetch relationships specified by keypaths for sourceObjects .
static void batchFetch(com.webobjects.foundation.NSArray sourceObjects, com.webobjects.foundation.NSArray keypaths, boolean skipFaultedSourceObjects, int batchSize)
          Overloads batchFetch(NSArray, NSArray, boolean) to batch through the NSArray of sourceObjects batchSize at a time.
static void batchFetch(com.webobjects.foundation.NSArray sourceObjects, java.lang.String keypath)
          Shortcut for batch fetching a single keypath.
static void batchFetch(com.webobjects.foundation.NSArray sourceObjects, java.lang.String keypath, boolean skipFaultedSourceObjects)
          Shortcut for batch fetching a single keypath.
static com.webobjects.foundation.NSArray batchFetchAndRetrieve(com.webobjects.foundation.NSArray sourceObjects, java.lang.String keypath)
          Shortcut for batch fetching a single keypath and returns returns the fetched values.
static com.webobjects.foundation.NSArray batchFetchAndRetrieve(com.webobjects.foundation.NSArray sourceObjects, java.lang.String keypath, boolean skipFaultedSourceObjects)
          Shortcut for batch fetching a single keypath and returns returns the fetched values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXBatchFetchUtilities

public ERXBatchFetchUtilities()
Method Detail

batchFetch

public static void batchFetch(com.webobjects.foundation.NSArray sourceObjects,
                              com.webobjects.foundation.NSArray keypaths)
Defaults skipFaultedSourceObjects to false for backwards compatibility

Parameters:
sourceObjects - the array of source object to fault keypaths on.
keypaths - the array of keypaths to fault
See Also:
batchFetch(NSArray, NSArray, boolean)

batchFetch

public static void batchFetch(com.webobjects.foundation.NSArray<? extends com.webobjects.eocontrol.EOEnterpriseObject> sourceObjects,
                              ERXKey<?>... keys)
Batch key the list of keys from the given source objects. No backwards compatibility here, so skipFaultedSourceObject is true.

Parameters:
sourceObjects - the array of source object to fault keypaths on.
keys - the array of ERXKeys to fault

batchFetch

public static void batchFetch(com.webobjects.eocontrol.EOEnterpriseObject sourceObject,
                              com.webobjects.foundation.NSArray keypaths,
                              boolean skipFaultedSourceObjects)
Shortcut for batch fetching a single source object

Parameters:
sourceObject - source object to fault keypaths on.
keypaths - the array of keypaths to fault
skipFaultedSourceObjects - if true, all source objects that already have their relationships faulted will be skipped
See Also:
batchFetch(NSArray, NSArray, boolean)

batchFetch

public static void batchFetch(com.webobjects.foundation.NSArray sourceObjects,
                              java.lang.String keypath)
Shortcut for batch fetching a single keypath. Defaults skipFaultedSourceObjects to true

Parameters:
sourceObjects - the array of source object to fault keypaths on.
keypath - the keypath to fault
See Also:
batchFetch(NSArray, NSArray, boolean)

batchFetch

public static void batchFetch(com.webobjects.foundation.NSArray sourceObjects,
                              java.lang.String keypath,
                              boolean skipFaultedSourceObjects)
Shortcut for batch fetching a single keypath.

Parameters:
sourceObjects - the array of source object to fault keypaths on.
keypath - the keypath to fault
skipFaultedSourceObjects - if true, all source objects that already have their relationships faulted will be skipped
See Also:
batchFetch(NSArray, NSArray, boolean)

batchFetchAndRetrieve

public static com.webobjects.foundation.NSArray batchFetchAndRetrieve(com.webobjects.foundation.NSArray sourceObjects,
                                                                      java.lang.String keypath)
Shortcut for batch fetching a single keypath and returns returns the fetched values. Defaults skipFaultedSourceObjects to true

Parameters:
sourceObjects - the array of source object to fault keypaths on.
keypath - the keypath to fault
See Also:
batchFetch(NSArray, NSArray, boolean)

batchFetchAndRetrieve

public static com.webobjects.foundation.NSArray batchFetchAndRetrieve(com.webobjects.foundation.NSArray sourceObjects,
                                                                      java.lang.String keypath,
                                                                      boolean skipFaultedSourceObjects)
Shortcut for batch fetching a single keypath and returns returns the fetched values.

Parameters:
sourceObjects - the array of source object to fault keypaths on.
keypath - the keypath to fault
skipFaultedSourceObjects - if true, all source objects that already have their relationships faulted will be skipped
See Also:
batchFetch(NSArray, NSArray, boolean)

batchFetch

public static void batchFetch(com.webobjects.foundation.NSArray sourceObjects,
                              com.webobjects.foundation.NSArray keypaths,
                              boolean skipFaultedSourceObjects)
Batch fetch relationships specified by keypaths for sourceObjects .

This method will use EODatabaseContext.batchFetchRelationship to efficiently fetch like relationships for many objects in as few as one database round trip per relationship.

For example, if fetching from Movie entities, you might specify paths of the form: ("directors","roles.talent", "plotSummary"). This works much like prefetching with fetch specifications, however this implementation is able to work around inheritance where prefetching fails.

Parameters:
sourceObjects - the array of source objects to fault keypaths on.
keypaths - the array of keypaths to fault
skipFaultedSourceObjects - if true, all source objects that already have their relationships faulted will be skipped

batchFetch

public static void batchFetch(com.webobjects.foundation.NSArray sourceObjects,
                              com.webobjects.foundation.NSArray keypaths,
                              boolean skipFaultedSourceObjects,
                              int batchSize)
Overloads batchFetch(NSArray, NSArray, boolean) to batch through the NSArray of sourceObjects batchSize at a time.

Parameters:
sourceObjects -
keypaths -
skipFaultedSourceObjects -
batchSize -
See Also:
batchFetch(NSArray, NSArray, boolean)
Author:
aman - Mar 11, 2009

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.