本文介绍了GWT中的requestfactory和findEntity方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用RequestFactory。我的ORM提供者是JPA。我有一个方法来检索名为findAll()的实体列表。当用户请求一个实体列表时,findAll被调用。查找所有对数据库执行查询并返回实体列表。但是,当requestFactory被要求将该列表发送回给用户时,requestfactory为列表中的每个实体调用findEntity()。



我的问题是:是否有任何方法可以指示请求工厂不为列表中的每个项目调用find实体?

SimpleRequestProcessor.createReturnOperations()确定您的域对象是否存在,以便发送适当的删除,持续或更新 WriteOperation 值。默认实现 ServiceLayer.isLive()调用finder方法来确定是否可以重新加载对象。您可以提供您自己的,覆盖 isLive()方法,通过继承 RequestFactoryServlet 并调用。


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.

这篇关于GWT中的requestfactory和findEntity方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 01:09