Re: Fetch Specifications defined in the .eomodel
Re: Fetch Specifications defined in the .eomodel
- Subject: Re: Fetch Specifications defined in the .eomodel
- From: Florijan Stamenkovic <email@hidden>
- Date: Mon, 14 Jan 2008 16:04:24 -0400
Stateless Remote Method Invocation is the only way I was able to get
model defined fetch specs on the client.
Client code:
private static final EODistributedObjectStore dos =
(EODistributedObjectStore)(EOEditingContext.defaultParentObjectStore());
/**
* Invokes the remote method on session to get a named fetch
specification. Needed because
* the whole eoaccess package is excluded from the client side
frameworks.
*
@param spec Fetch specification name.
@param entity Name of the entity for which the fetch specification
is for.
@return The fetch specification, or null if it is not in the model,
or an error occured
*/
public static EOFetchSpecification getFetchSpecification(
String spec,
String entity){
//invoke!
return (EOFetchSpecification)
dos .invokeStatelessRemoteMethodWithKeyPath(
"session",
"clientSideRequestGetFetchSpecification",
new Class[]{String.class, String.class},
new String[]{spec, entity});
}
Server code, in the Session class:
/**
* Loads and returns an <tt>EOFetchSpecification</tt> objects for the
given
* specification and entity name.
*
@param spec Name of the specification
@param entity Name of the entitiy
@return A fetch specification, or <tt>null</tt> if it is not found,
or an
error occurs
*/
public EOFetchSpecification getFetchSpecification(String spec,
String entity){
try{
return EOFetchSpecification.fetchSpecificationNamed(spec, entity);
}catch(Exception ex){
return null;
}
}
Btw sorry for not seeing this post before, I'm busy, so not keeping
track of things.
Flor
On Jan 10, 2008, at 12:45, David Avendasora wrote:
Hi all, especially you Java Client people out there.
While I can easily build a FS in my client-side Java code and
execute it, does anyone know if it is possible, and if so, how to,
call a FS that is defined in the .eomodel file from a client-side
class?
Right now, if I try calling it, I just get null back. No error, no
complaint, nothing anywhere saying why it isn't working.
Thanks,
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden