MyEclipse for Spring
Code Reference: GwtCustomer.java
The shared transfer type used by the GWT client. This page explains why it differs from the entity and how it is mapped.
GwtCustomer is the transfer type shared by the GWT client and the remote service. It is not the entity. It carries only the fields that the client screen needs, and it has no persistence annotations. That separation keeps the client contract stable when the data model changes.
Fields
- id. The record key, or null for a new record.
- name. The display name.
- email. The contact address.
- status. The current status value.
Mapping
The remote service maps between the entity and the transfer type. Keep the mapping in one place, usually a small converter class. A second mapping in the client drifts and produces screens that disagree with the server.
The transfer type is generated from the model. Mark the fields that should reach the client so that the generator does not copy the whole entity. That keeps the payload small and the contract easy to explain.