
Public Member Functions | |
| void | addToObjectsRelationship (NSArray< D > objects) |
| void | addToObjectsRelationship (D object) |
| Integer | countObjects () |
| void | deleteAllObjectsRelationships () |
| void | deleteObjectRelationship (D object) |
| ERXUnmodeledToManyRelationship (S sourceObject, String destinationEntityName, ERXKey< S > reverseRelationshipKey, boolean isDeep) | |
| ERXUnmodeledToManyRelationship (S sourceObject, String destinationEntityName, ERXKey< S > reverseRelationshipKey) | |
| ERXFetchSpecification< D > | fetchSpecificationForObjects () |
| NSArray< D > | objects (EOQualifier qualifier, NSArray< EOSortOrdering > sortOrderings, boolean fetch) |
| NSArray< D > | objects (EOQualifier qualifier, boolean fetch) |
| NSArray< D > | objects (EOQualifier qualifier) |
| NSArray< D > | objects () |
| EOQualifier | qualifierForObjects () |
| void | removeFromObjectsRelationship (NSArray< D > objects) |
| void | removeFromObjectsRelationship (D object) |
Private Member Functions | |
| NSArray< String > | destinationEntityNames () |
| NSMutableArray< D > | insertedObjects () |
| NSArray< D > | persistedObjects () |
Static Private Member Functions | |
| static NSArray< String > | entityHierarchyNamesForEntityNamed (EOEditingContext ec, String rootEntityName) |
Private Attributes | |
| NSArray< String > | _destinationEntityNames |
| final String | destinationEntityName |
| final boolean | isDeep |
| final ERXKey< S > | reverseRelationshipKey |
| final S | sourceObject |
Static Private Attributes | |
| static ConcurrentHashMap < String, NSArray< String > > | _entityHierarchies = new ConcurrentHashMap<String, NSArray<String>>() |
This class is for simple to many relationships, has not been tested on flattened toMany relationships having a join table, aka "many-to-many" relationships.
Usage: Lazily create a private instance of this inside an EO passing in the appropriate constructor parameters and then implement cover methods similar to those that would have been available thru the normal Entity templates calling the corresponding methods of this class.
For example, you might do this in an entity named CTMediaTemplate that formerly had a 'messages' relationship to CTMessage but due to the huge size of the toMany impacting performance, the toMany side of the relationship had to be deleted from the EOModel:
private ERXUnmodeledToManyRelationship<CTMediaTemplate, CTMessage> _messagesRelationship;
Lazily initialize the helper class public ERXUnmodeledToManyRelationship<CTMediaTemplate, CTMessage> messagesRelationship() { if (_messagesRelationship == null) { _messagesRelationship = new ERXUnmodeledToManyRelationship<CTMediaTemplate, CTMessage>(this, CTMessage.ENTITY_NAME, CTMessage.XKEY_MEDIA_TEMPLATE); } return _messagesRelationship; }
public Integer countMessages() { return messagesRelationship().countObjects(); }
public EOQualifier qualifierForMessages() { return messagesRelationship().qualifierForObjects(); }
public NSArray<CTMessage> messages() { return messagesRelationship().objects(); }
public ERXFetchSpecification<CTMessage> fetchSpecificationForMessages() { return messagesRelationship().fetchSpecificationForObjects(); }
public NSArray<CTMessage> messages(EOQualifier qualifier) { return messagesRelationship().objects(qualifier); }
public NSArray<CTMessage> messages(EOQualifier qualifier, boolean fetch) { return messagesRelationship().objects(qualifier, null, fetch); }
public NSArray<CTMessage> messages(EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings, boolean fetch) { return messagesRelationship().objects(qualifier, sortOrderings, fetch); }
public void addToMessagesRelationship(CTMessage object) { messagesRelationship().addToObjectsRelationship(object); }
public void removeFromMessagesRelationship(CTMessage object) { messagesRelationship().removeFromObjectsRelationship(object); }
public void deleteMessagesRelationship(CTMessage object) { messagesRelationship().deleteObjectRelationship(object); }
public void deleteAllMessagesRelationships() { messagesRelationship().deleteAllObjectsRelationships(); }
| ERXUnmodeledToManyRelationship | ( | S | sourceObject, | |
| String | destinationEntityName, | |||
| ERXKey< S > | reverseRelationshipKey | |||
| ) |
Standard constructor where the destination entity is a single type. Excludes entities that might inherit from the destination entity
| sourceObject | ||
| destinationEntityName | ||
| reverseRelationshipKey |
| ERXUnmodeledToManyRelationship | ( | S | sourceObject, | |
| String | destinationEntityName, | |||
| ERXKey< S > | reverseRelationshipKey, | |||
| boolean | isDeep | |||
| ) |
A constructor that allows isDeep to be set to true to handle destination entity that is the super class of an inheritance hierarchy. The inherited entities are included in the methods that return arrays of destination EOEnterpriseObjects.
| sourceObject | ||
| destinationEntityName | ||
| reverseRelationshipKey | ||
| isDeep |
| void addToObjectsRelationship | ( | NSArray< D > | objects | ) |
| void addToObjectsRelationship | ( | D | object | ) |
| Integer countObjects | ( | ) |
| void deleteAllObjectsRelationships | ( | ) |
| void deleteObjectRelationship | ( | D | object | ) |
| NSArray<String> destinationEntityNames | ( | ) | [private] |
| static NSArray<String> entityHierarchyNamesForEntityNamed | ( | EOEditingContext | ec, | |
| String | rootEntityName | |||
| ) | [static, private] |
| rootEntityName |
| ERXFetchSpecification<D> fetchSpecificationForObjects | ( | ) |
| NSMutableArray<D> insertedObjects | ( | ) | [private] |
| NSArray<D> objects | ( | EOQualifier | qualifier, | |
| NSArray< EOSortOrdering > | sortOrderings, | |||
| boolean | fetch | |||
| ) |
| NSArray<D> objects | ( | EOQualifier | qualifier, | |
| boolean | fetch | |||
| ) |
| NSArray<D> objects | ( | EOQualifier | qualifier | ) |
| NSArray<D> objects | ( | ) |
| NSArray<D> persistedObjects | ( | ) | [private] |
| EOQualifier qualifierForObjects | ( | ) |
| void removeFromObjectsRelationship | ( | NSArray< D > | objects | ) |
| void removeFromObjectsRelationship | ( | D | object | ) |
NSArray<String> _destinationEntityNames [private] |
ConcurrentHashMap<String, NSArray<String> > _entityHierarchies = new ConcurrentHashMap<String, NSArray<String>>() [static, private] |
final String destinationEntityName [private] |
final boolean isDeep [private] |
final ERXKey<S> reverseRelationshipKey [private] |
final S sourceObject [private] |
1.5.8