【发布时间】:2023-05-28 01:59:01
【问题描述】:
以下是我的域类
class Person {
String getName();
Vehicle getVehicle();
}
interface Vehicle {
String getCompanyName();
String getRegNo();
Point getParkingSpaceRequired();
}
abstract class AbstractVehicle {
}
class Motorcycle extends AbstractVehicle {
}
class Car extends AbstractVehicle {
}
将 PersonProxy 创建为 EntityProxy 很简单,并且适用于 person.getName()
我创建了 VehicleProxy 作为 ValueProxy 并使用 .with('vehicle') 调用了 fire() 但我收到错误:
域类型 com....AbstractVehicle$$EnhancerByCGLIB$$e86549b9 无法发送给客户端。
在 PersonProxy 上
我得到了@ProxyFor(value=Person.class,locator=PersonLocator.class)
在 VehicleProxy 上,我得到了 @ProxyFor(value=Vehicle.class)
那么,如何在 RequestFactory 中处理这种继承?
我应该将 Vehicle 从 ValueProxy 更改为 EntityProxy 吗?
那么如何实现 VehicleLocator 的方法呢?
【问题讨论】:
标签: gwt requestfactory