Updating REST Resources
This topic explains how to update REST resources after
introducing changes to EJB resources.
Changing EJB Modeled Object Fields
EJB-REST Wizard will automatically detect any changes made to the
fields in the Modeled EJB Object. To re-RESTify a DTO you should:
- Open a GET method which uses the DTO.
- Navigate to Configure REST DTO page for the DTO
which should be re-RESTified.
- Continue clicking FINISH until code generation is
This is a convenient way to run through all the necessary DTO
- Determine all the top-level DTOs which are based on the
modified Modeled Object or have nested DTOs based on it.
- For each determined top-level DTO perform:
- Select one method which shares the top-level DTO and
open it in the Configuring REST Method wizard.
Such methods can be easily recognized by its return type.
For example, the Country DTO is shared by the three
methods: GET-getCountry(), POST-addCountry()
and PUT-updateCountry(). To open the Configure
REST DTO page, select the DTO inside the Request
Body section of the Configuring REST Method
wizard, and click the Edit button.
- If necessary, keep opening Configure REST DTO
pages for nested DTOs. To open the page for a nested DTO,
select it inside the Fields (or Pull-Through
Fields) table, and click the Edit button.
- For non-reference DTOs, the newly opened Configure
REST DTO page displays updated field set inside the
Fields (or Pull-Through Fields): new fields
are checked and deleted ones are not shown at all. For
reference DTOs (*_REF or *_REFS), new fields are