On Wed, 20 Aug 2014 19:10:03 +0000
Chuck Hill <[email protected]> wrote:

> It is in EOUtilities
> 
> static EOEnterpriseObject objectWithPrimaryKey(EOEditingContext ec,
> String entityName, NSDictionary pkDict) Fetches the Enterprise Object
> identified by the specified primary key dictionary.
> 

If you are using a primary key that is not a compound key, you probably
want to use these methods in ERXEOControlUtilities in Wonder.

I usually remember where these are by thinking "yes, primary key methods
are usually in classes that have to do with EOAccess but they are not in
the ERXEOAccessUtilities class, so ... there they are."

objectWithPrimaryKeyValue(EOEditingContext ec, 
                                String entityName, 
                                Object primaryKeyValue, 
                                NSArray prefetchingKeyPaths)

objectWithPrimaryKeyValue(EOEditingContext ec, 
                                String entityName, 
                                Object primaryKeyValue, 
                                NSArray prefetchingKeyPaths, 
                                boolean refreshRefetchedObjects)

objectWithPrimaryKeyValue(EOEditingContext ec, 
                                String entityName, 
                                Object primaryKeyValue, 
                                NSArray prefetchingKeyPaths, 
                                boolean refreshRefetchedObjects, 
                                boolean throwIfMissing)


> On 2014-08-20, 12:07 PM, "Fred Opims" wrote:
> 
> Thank you John!
> I've used this format in an url.
> But how can i fetch Person 100 with fetch methode directly in Java ?
> 
> Here are the fetch method provided in a ERXGenericRecord.
> 
> I have not found a method using the primary key.
> 
> public static ERXFetchSpecification<User> fetchSpec()
> public static NSArray<User> fetchAllUsers(EOEditingContext
> editingContext) public static NSArray<User>
> fetchAllUsers(EOEditingContext editingContext,
> NSArray<EOSortOrdering> sortOrderings) public static NSArray<User>
> fetchUsers(EOEditingContext editingContext, EOQualifier qualifier,
> NSArray<EOSortOrdering> sortOrderings) public static User
> fetchUser(EOEditingContext editingContext, String keyName, Object
> value) public static User fetchUser(EOEditingContext editingContext,
> EOQualifier qualifier) public static User
> fetchRequiredUser(EOEditingContext editingContext, String keyName,
> Object value) public static User fetchRequiredUser(EOEditingContext
> editingContext, EOQualifier qualifier)
> 
> Thank you!
> 
> 
> 
> On Wed, Aug 20, 2014 at 2:27 PM, John Huss
> <[email protected]<mailto:[email protected]>>
> wrote: .../Person/100
> 
> It's <entityName>/<primaryKey>
> 
> 
> On Wed, Aug 20, 2014 at 12:26 PM, Fred Opims
> <[email protected]<mailto:[email protected]>> wrote: Hello!
> I'm using ErRest and i would like to fetch an entity from an id.
> 
> So far  I'm using an keyName (attribute) to fetch an entity. For the
> case i'm working on, I only have its id.
> 
> Do you know how to do that ?
> 
> Thank you
> 
> Best!
> 
> Fred
> 
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list
> ([email protected]<mailto:[email protected]>)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/johnthuss%40gmail.com
> 
> This email sent to [email protected]<mailto:[email protected]>
> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to