Junos Space SDK > Developer Guides > Junos Space Application Developer Guide > Programming with the Junos Space SDK > Using the Junos Space SDK Plug-in > Using the EJB-REST Wizard

Updating REST Resources

This topic explains how to update REST resources after introducing changes to EJB resources.

Updating DTOs

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:
  1. Open a GET method which uses the DTO.
  2. Navigate to Configure REST DTO page for the DTO which should be re-RESTified.
  3. Continue clicking FINISH until code generation is performed.
This is a convenient way to run through all the necessary DTO pages:
  1. Determine all the top-level DTOs which are based on the modified Modeled Object or have nested DTOs based on it.
  2. 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 deselected.