Le 2012-03-05 à 12:26, Jesse Tayler a écrit :
> you realize that if your route contains an ID, you can just get the object by
> asking
You need it when you want to have a different "primary key", in
wocommunity.org, it's for the organization name.
> Note aNote = routeObjectForKey("note");
>
> a route that looks like
>
> /ra/Note/121.html
>
> already gives you the id for that note as the route object.
>
>
>
>
> On Mar 5, 2012, at 12:07 PM, Pascal Robert <[email protected]> wrote:
>
>>
>> Le 2012-03-05 à 11:33, Ron X a écrit :
>>
>>> hi,
>>> i have this code:
>>> @Override
>>> public Note objectOfEntityWithID(EOClassDescription entity, Object id,
>>> ERXRestContext context) {
>>> ....
>>> Note - is the entity.
>>> When i go there - in this method - i have the right id and entity...But how
>>> can i get the object (Note) from it? Just simple get the object :-)
>>> (I don't want to refetch objects again from ERXQ.filtered and other like it
>>> had shown in example)
>>
>> public Object objectOfEntityWithID(EOClassDescription entity, Object id,
>> ERXRestContext context) {
>> return
>> OrganizationProfile.fetchOrganizationProfile(ERXEC.newEditingContext(),
>> OrganizationProfile.COMPANY_NAME.eq((String)id);
>> }
>> _______________________________________________
>> 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/jtayler%40oeinc.com
>>
>> This email sent to [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/probert%40macti.ca
>
> This email sent to [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]