How to Customize Getter and Setter's Body?
In generated ORM code, getters and setters will be generated for attributes added to every ORM Persistable class. Sometimes, you may want to customize the method body of those getters and setters, like to apply security checking or to print a statement upon the updating of data. In these cases, you can customize the getter and setter of attribute to add the code you want.
|A part of the generated code, showing the getters and setters generated from attributes of an ORM Persistable class
To customize getter/setter of attribute:
- Right click on the attribute that you want to customize its getter or setting and select Open Specification... from the popup menu.
Opening the specification of attribute
- Open the ORM Attribute Detail tab and enter the code body in Getter/Setter code sections.
Customizing the setter of attribute
The following resources may help you to learn more about the topic discussed in this page.
|4. Using generated code||Table of Contents||Chapter 7. State Machine Diagram Code Generation|