To edit or add content to this Wiki, you can simply create a new account at

These additions are based on a more advanced Stateless RMI concept by Florijan Stamenkovic.

public EOFetchSpecification clientSideRequestGetFetchSpecification(String fetchSpecification,
                                                                   String entity) {
	return getFetchSpecification(fetchSpecification,

 * Loads and returns an <tt>EOFetchSpecification</tt> objects for the given specification and entity name.
 * @param fetchSpecification
 *            Name of the specification
 * @param entity
 *            Name of the entity
 * @return A fetch specification, or <tt>null</tt> if it is not found, or an error occurs
public EOFetchSpecification getFetchSpecification(String fetchSpecification,
                                                  String entity) {
	try {
		// NSLog.out.appendln("About to call FetchSpecification " +
		// fetchSpecification + " on Entity " + entity);
		return EOFetchSpecification.fetchSpecificationNamed(fetchSpecification,
	} catch (Exception ex) {
		return null;


Due to security concerns you cannot call FetchSpecifications from the client-side that use a Raw SQL Expression without implementing the delegate method distributionContextShouldFetchObjectsWithFetchSpecification which this code does NOT do.

If you try to, you will get the following exception in the server log:

Server exception: The fetchSpecification YourFetchSpecificationWithRawSQLExpression was not allowed to execute on the server. If your application needs to execute this method, the security needs to be relaxed by implementing the delegate method distributionContextShouldFetchObjectsWithFetchSpecification

and this code will return null to the client instead of the expected FetchSpecification.

  • No labels