Skip to content

Commit

Permalink
add method to set prefetching key paths with ERXKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
darkv authored and Pascal Robert committed Apr 15, 2012
1 parent 4ea823e commit 297c5b0
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -12,6 +12,7 @@
import com.webobjects.eocontrol.EOSortOrdering; import com.webobjects.eocontrol.EOSortOrdering;
import com.webobjects.foundation.NSArray; import com.webobjects.foundation.NSArray;
import com.webobjects.foundation.NSDictionary; import com.webobjects.foundation.NSDictionary;
import com.webobjects.foundation.NSMutableArray;
import com.webobjects.foundation.NSMutableDictionary; import com.webobjects.foundation.NSMutableDictionary;
import com.webobjects.foundation.NSPropertyListSerialization; import com.webobjects.foundation.NSPropertyListSerialization;


Expand All @@ -33,11 +34,11 @@ public class ERXFetchSpecification<T extends EOEnterpriseObject> extends EOFetch
private NSMutableDictionary _userInfo; private NSMutableDictionary _userInfo;
private boolean _includeEditingContextChanges; private boolean _includeEditingContextChanges;


public ERXFetchSpecification(String entityName, EOQualifier qualifier, NSArray sortOrderings, boolean usesDistinct, boolean isDeep, NSDictionary hints) { public ERXFetchSpecification(String entityName, EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings, boolean usesDistinct, boolean isDeep, NSDictionary hints) {
super(entityName, qualifier, sortOrderings, usesDistinct, isDeep, hints); super(entityName, qualifier, sortOrderings, usesDistinct, isDeep, hints);
} }


public ERXFetchSpecification(String entityName, EOQualifier qualifier, NSArray sortOrderings) { public ERXFetchSpecification(String entityName, EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings) {
super(entityName, qualifier, sortOrderings); super(entityName, qualifier, sortOrderings);
} }


Expand Down Expand Up @@ -156,6 +157,14 @@ public NSArray<NSDictionary<String, Object>> fetchRawRows(EOEditingContext ec) {
public void setRawRowKeyPaths(String keyPath, String... keyPaths) { public void setRawRowKeyPaths(String keyPath, String... keyPaths) {
super.setRawRowKeyPaths(new NSArray<String>(keyPath, keyPaths)); super.setRawRowKeyPaths(new NSArray<String>(keyPath, keyPaths));
} }

public void setPrefetchingRelationshipKeyPaths(ERXKey<?>... prefetchingRelationshipKeyPaths) {
NSMutableArray<String> keypaths = new NSMutableArray<String>();
for (ERXKey<?> key : prefetchingRelationshipKeyPaths) {
keypaths.addObject(key.key());
}
setPrefetchingRelationshipKeyPaths(keypaths);
}


/** /**
* Collects all relevant attributes and the bindings and returns a key suitable for caching. * Collects all relevant attributes and the bindings and returns a key suitable for caching.
Expand Down

0 comments on commit 297c5b0

Please sign in to comment.