Re: faultWithPrimaryKeyValue, make sure it only returns a fault

2006-10-13 Thread Chuck Hill


On Oct 13, 2006, at 12:50 AM, Dev WO wrote:


Hi,
I'm using faultWithPrimaryKeyValue to access an eo in a sharedEC.
I was using it thinking it would return only faulted eos in the  
sharedEC, but after reading the java doc again, I think it may do a  
fetch to access the object (if not available in the fault).


Yes.


So my issue is that I'm fetching object in the sharedEC with  
specific parameters, but when I request an object through  
faultWithPrimaryKeyValue, I can access object that doesn't conform  
to the sharedEC specific parameters.


Yes.


For example, I can have an attribute "available" (boolean) on my  
object and only put the ones with available=true in my sharedEC.  
But I can still acces all the objet through my specific action  
using faultWithPrimaryKeyValue which is not what I want:)


Yes.  :-)



Is there a way to request only a fault from a specific ec?


No.


Or do I have to test for the specific attributes after I get the  
object? (If I can avoid this, it is really nice:))


If you can get an EOGlobalID instead of creating a fault (see  
EOKeyGlobalID.globalIDWithEntityName and EOEntity.globalIDForRow) you  
can use EOEditingContext's objectForGlobalID "Returns the  
EOEnterpriseObject associated with gid in this EOEditingContext or  
its shared context, or null if no such object exists."


Chuck


--

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.http://www.global-village.net/products/practical_webobjects






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

This email sent to archive@mail-archive.com


faultWithPrimaryKeyValue, make sure it only returns a fault

2006-10-13 Thread Dev WO

Hi,
I'm using faultWithPrimaryKeyValue to access an eo in a sharedEC.
I was using it thinking it would return only faulted eos in the  
sharedEC, but after reading the java doc again, I think it may do a  
fetch to access the object (if not available in the fault).


So my issue is that I'm fetching object in the sharedEC with specific  
parameters, but when I request an object through  
faultWithPrimaryKeyValue, I can access object that doesn't conform to  
the sharedEC specific parameters.


For example, I can have an attribute "available" (boolean) on my  
object and only put the ones with available=true in my sharedEC. But  
I can still acces all the objet through my specific action using  
faultWithPrimaryKeyValue which is not what I want:)


Is there a way to request only a fault from a specific ec?
Or do I have to test for the specific attributes after I get the  
object? (If I can avoid this, it is really nice:))


Thanks

Xavier
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com