I am trying to use RequestFactory. My ORM provider is JPA. I have a method to retrieve a list of entity called findAll(). When the user requests for a list of entities, findAll is called. Find all executes a query against database and returns a list of entities. However, when requestFactory is asked to send this list back to the user, requestfactory calls findEntity() for each entity in the list.
My question is: is there any way I can instruct request factory to not call find entity for each item in the list?
This is likely from SimpleRequestProcessor.createReturnOperations()
determining whether or not your domain objects are live, in order to send the appropriate Delete, Persist, or Update WriteOperation
value. The default implementation of ServiceLayer.isLive()
calls the finder method to determine if the object can be re-loaded. You can provide your own subclass of ServiceLayerDecorator
that overrides the isLive()
method by subclassing RequestFactoryServlet
and calling the multi-arg super-constructor.
来源:https://stackoverflow.com/questions/6083346/requestfactory-and-findentity-method-in-gwt