In GWT 2.1.1, the Id and Version properties can be of any type that RequestFactory knows how to transport. In principle, any primitive type ( int ), type in a box ( Integer ), or any object that has an associated proxy type. You do not need to reduce the composite identifier to String yourself; RF plumbing can automatically handle compound keys using a constant key of an object type key or a serialized key of a value type key.
Using a previously published example:
interface Location { public String getDepartment(); public String getDesk(); } interface Employee { public Location getId(); public int getVersion(); } @ProxyFor(Location.class) interface LocationProxy extends ValueProxy {
If you cannot reduce the identifier to a single getId() property in a domain type, you can use Locator to provide an external id and version property. For instance:
@ProxyFor(value = Employee.class, locator = EmployeeLocator.class) interface EmployeeProxy {.....} class EmployeeLocator extends Locator<Employee, String> {
DevGuide related to the question is a bit outdated regarding the Change in RequestFactory in 2.1.1
source share