Creating Transfer Objects
Transfer Object is used as a proxy between an entity bean and its client. Entity beans use transfer objects to send data to the clients thus reducing the exchange traffic, because all required data are transferred at once, packed in a single object.
Though you can create a transfer object manually, as a class that implements the
Serializable interface and provides accessor methods to certain fields of
an entity bean, IntelliJ IDEA helps automatically generate stub source code.
To create a transfer object
- In the EJB tool window, right-click the desired entity bean.
- On the context menu, click , and then choose on the submenu.
- In the dialog box Select Accessors of Fields to Include in Transfer Object, select the methods to be included in the new transfer object.
- Specify the following parameters:
- Name of the transfer object class. Note that IntelliJ IDEA suggests a pattern for generating the class name, so you can only change the initial part of it.
- Whether the accessor methods will be generated in the bean interface.
- Click OK.