Dashboard > WOProject / WOLips > ... > EOGenerator Templates and Additions > Session.java Addition
  WOProject / WOLips Log In View a printable version of the current page.  
  Session.java Addition
Added by David Avendasora, last edited by Francis Labrie on Mar 06, 2008  (view change)
Labels: 
(None)

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

public EOFetchSpecification clientSideRequestGetFetchSpecification(String fetchSpecification, String entity) {
	return getFetchSpecification(fetchSpecification, entity);
}
	
public EOFetchSpecification getFetchSpecification(String fetchSpecification, String entity){
	try{
		return EOFetchSpecification.fetchSpecificationNamed(fetchSpecification, entity);
	}catch(Exception ex){
		NSLog.out.appendln(ex);
		return null;
	}
}
Caution

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.

Site running on a free Atlassian Confluence Open Source Project License granted to ObjectStyle. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators