GWT 中的 requestfactory 和 findEntity 方法 [英] requestfactory and findEntity method in GWT

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

问题描述

我正在尝试使用 RequestFactory.我的 ORM 提供程序是 JPA.我有一种方法可以检索名为 findAll() 的实体列表.当用户请求实体列表时,会调用 findAll.Find all 对数据库执行查询并返回实体列表.但是,当 requestFactory 被要求将此列表发送回用户时,requestfactory 会为列表中的每个实体调用 findEntity().

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?

推荐答案

这可能来自 SimpleRequestProcessor.createReturnOperations() 确定您的域对象是否处于活动状态,以便发送适当的删除、保持或更新 WriteOperation 值.ServiceLayer.isLive() 的默认实现调用 finder 方法来确定是否可以重新加载对象.您可以提供自己的 ServiceLayerDecorator 通过子类化 RequestFactoryServlet 覆盖了 isLive() 方法并调用 多参数超级构造函数.

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 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆