Project Wonder 5.0.0.8795

er.extensions.eof
Class ERXEOGlobalIDUtilities

java.lang.Object
  extended by er.extensions.eof.ERXEOGlobalIDUtilities

public class ERXEOGlobalIDUtilities
extends Object

Utilities that help with batch loading sets of global IDs.

Author:
ak

Nested Class Summary
static class ERXEOGlobalIDUtilities.Info
          Unencrypts the byte array of NSData PKs so you get the process number or port, host and timestamp.
 
Field Summary
static Logger log
          logging support
 
Constructor Summary
ERXEOGlobalIDUtilities()
           
 
Method Summary
static NSMutableArray fetchObjectsWithGlobalIDs(EOEditingContext ec, NSArray globalIDs)
          Fetches an array of objects defined by the globalIDs in a single fetch per entity without refreshing refetched objects.
static NSMutableArray fetchObjectsWithGlobalIDs(EOEditingContext ec, NSArray globalIDs, boolean refreshesRefetchedObjects)
          Fetches an array of objects defined by the globalIDs in a single fetch per entity.
static EOEnterpriseObject fetchObjectWithGlobalID(EOEditingContext ec, EOGlobalID gid)
          Fetches an object defined by gid without refreshing refetched objects.
static NSArray fireFaultsForGlobalIDs(EOEditingContext ec, NSArray globalIDs)
          Fires all faults in the given global IDs on one batch.
static NSArray fireFaultsForGlobalIDs(EOEditingContext ec, NSArray globalIDs, NSArray prefetchingKeypaths)
          Fires all faults in the given global IDs on one batch together with their relationships.
static NSDictionary globalIDsGroupedByEntityName(NSArray globalIDs)
          Groups an array of global IDs by their entity name.
static NSArray<EOGlobalID> globalIDsWithPrimaryKeyValues(String entityName, NSArray<Object> values)
          Translates an array of single-value raw primary values to EOGlobalIDs.
static NSArray<Object> primaryKeyValuesWithGlobalIDs(NSArray<EOGlobalID> globalIDs)
          Translates an array of EOGlobalID to primary key values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final Logger log
logging support

Constructor Detail

ERXEOGlobalIDUtilities

public ERXEOGlobalIDUtilities()
Method Detail

globalIDsGroupedByEntityName

public static NSDictionary globalIDsGroupedByEntityName(NSArray globalIDs)
Groups an array of global IDs by their entity name.

Parameters:
globalIDs -

primaryKeyValuesWithGlobalIDs

public static NSArray<Object> primaryKeyValuesWithGlobalIDs(NSArray<EOGlobalID> globalIDs)
Translates an array of EOGlobalID to primary key values. Returns null if the given global IDs are not EOKeyValueGlobalIDs and the primary keys are not single values.

Parameters:
globalIDs -

globalIDsWithPrimaryKeyValues

public static NSArray<EOGlobalID> globalIDsWithPrimaryKeyValues(String entityName,
                                                                NSArray<Object> values)
Translates an array of single-value raw primary values to EOGlobalIDs.

Parameters:
entityName -
values -

fetchObjectWithGlobalID

public static EOEnterpriseObject fetchObjectWithGlobalID(EOEditingContext ec,
                                                         EOGlobalID gid)
Fetches an object defined by gid without refreshing refetched objects.

Parameters:
ec - the editing context to fetch within
gid - the global id to fetch
Returns:
the fetched EO

fetchObjectsWithGlobalIDs

public static NSMutableArray fetchObjectsWithGlobalIDs(EOEditingContext ec,
                                                       NSArray globalIDs)
Fetches an array of objects defined by the globalIDs in a single fetch per entity without refreshing refetched objects.

Parameters:
ec - the editing context to fetch within
globalIDs - the global ids to fetch
Returns:
the fetched EO's

fetchObjectsWithGlobalIDs

public static NSMutableArray fetchObjectsWithGlobalIDs(EOEditingContext ec,
                                                       NSArray globalIDs,
                                                       boolean refreshesRefetchedObjects)
Fetches an array of objects defined by the globalIDs in a single fetch per entity.

Parameters:
ec - the editing context to fetch within
globalIDs - the global ids to fetch
refreshesRefetchedObjects - whether or not to refresh refetched objects
Returns:
the fetched EO's

fireFaultsForGlobalIDs

public static NSArray fireFaultsForGlobalIDs(EOEditingContext ec,
                                             NSArray globalIDs,
                                             NSArray prefetchingKeypaths)
Fires all faults in the given global IDs on one batch together with their relationships. This is much more efficient than triggering the individual faults and relationships later on. The method should use only 1 fetch for all objects per entity and then one for each relationship per entity.

Parameters:
ec -
globalIDs -
prefetchingKeypaths -

fireFaultsForGlobalIDs

public static NSArray fireFaultsForGlobalIDs(EOEditingContext ec,
                                             NSArray globalIDs)
Fires all faults in the given global IDs on one batch. This is much more efficient than triggering the individual faults later on. The method should use only 1 fetch for all objects per entity.

Parameters:
ec -
globalIDs -

Last updated: Fri, Jan 9, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.