Project Wonder 5.0

er.extensions.eof
Class ERXEOGlobalIDUtilities

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

public class ERXEOGlobalIDUtilities
extends java.lang.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 org.apache.log4j.Logger log
          logging support
 
Constructor Summary
ERXEOGlobalIDUtilities()
           
 
Method Summary
static com.webobjects.eocontrol.EOKeyGlobalID createGlobalID(java.lang.String entityName, java.lang.Object[] values)
           
static com.webobjects.foundation.NSMutableArray fetchObjectsWithGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.foundation.NSArray globalIDs)
          Fetches an array of objects defined by the globalIDs in a single fetch per entity without refreshing refetched objects.
static com.webobjects.foundation.NSMutableArray fetchObjectsWithGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.foundation.NSArray globalIDs, boolean refreshesRefetchedObjects)
          Fetches an array of objects defined by the globalIDs in a single fetch per entity.
static com.webobjects.eocontrol.EOEnterpriseObject fetchObjectWithGlobalID(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.eocontrol.EOGlobalID gid)
          Fetches an object defined by gid without refreshing refetched objects.
static com.webobjects.foundation.NSArray fireFaultsForGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.foundation.NSArray globalIDs)
          Fires all faults in the given global IDs on one batch.
static com.webobjects.foundation.NSArray fireFaultsForGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.foundation.NSArray globalIDs, com.webobjects.foundation.NSArray prefetchingKeypaths)
          Fires all faults in the given global IDs on one batch together with their relationships.
static com.webobjects.foundation.NSDictionary globalIDsGroupedByEntityName(com.webobjects.foundation.NSArray globalIDs)
          Groups an array of global IDs by their entity name.
static com.webobjects.foundation.NSArray<com.webobjects.eocontrol.EOGlobalID> globalIDsWithPrimaryKeyValues(java.lang.String entityName, com.webobjects.foundation.NSArray<java.lang.Object> values)
          Translates an array of single-value raw primary values to EOGlobalIDs.
static com.webobjects.foundation.NSArray<java.lang.Object> primaryKeyValuesWithGlobalIDs(com.webobjects.foundation.NSArray<com.webobjects.eocontrol.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 org.apache.log4j.Logger log
logging support

Constructor Detail

ERXEOGlobalIDUtilities

public ERXEOGlobalIDUtilities()
Method Detail

globalIDsGroupedByEntityName

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

Parameters:
globalIDs -

primaryKeyValuesWithGlobalIDs

public static com.webobjects.foundation.NSArray<java.lang.Object> primaryKeyValuesWithGlobalIDs(com.webobjects.foundation.NSArray<com.webobjects.eocontrol.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 com.webobjects.foundation.NSArray<com.webobjects.eocontrol.EOGlobalID> globalIDsWithPrimaryKeyValues(java.lang.String entityName,
                                                                                                                   com.webobjects.foundation.NSArray<java.lang.Object> values)
Translates an array of single-value raw primary values to EOGlobalIDs.

Parameters:
entityName -
values -

fetchObjectWithGlobalID

public static com.webobjects.eocontrol.EOEnterpriseObject fetchObjectWithGlobalID(com.webobjects.eocontrol.EOEditingContext ec,
                                                                                  com.webobjects.eocontrol.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 com.webobjects.foundation.NSMutableArray fetchObjectsWithGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec,
                                                                                 com.webobjects.foundation.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 com.webobjects.foundation.NSMutableArray fetchObjectsWithGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec,
                                                                                 com.webobjects.foundation.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 com.webobjects.foundation.NSArray fireFaultsForGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec,
                                                                       com.webobjects.foundation.NSArray globalIDs,
                                                                       com.webobjects.foundation.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 com.webobjects.foundation.NSArray fireFaultsForGlobalIDs(com.webobjects.eocontrol.EOEditingContext ec,
                                                                       com.webobjects.foundation.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 -

createGlobalID

public static com.webobjects.eocontrol.EOKeyGlobalID createGlobalID(java.lang.String entityName,
                                                                    java.lang.Object[] values)

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

Copyright © 2002 – 2007 Project Wonder.