Here is how you can create Transient View Object.
- Create New View Object, make sure to create View object in default views package. We will re-factor into different package later. This is done as JDeveloper at times creates Java files in wrong package otherwise.
- Use consistent suffix for View Object Name to indicate that it is Transient View Object.
- Select Programmatic option for Data Source in View Object wizard.
- Add attributes as needed.
- Make sure all Attributes are always updatable and set to be persisted. Also, Make sure to define a Primary Key attribute (one or more) for View object.
- Finish View Object creation wizard.
- Go to general tab, expand Tuning and Make sure No Rows is selected for Retrieve from the Database section.
- Save your work.
- Refactor Transient View Object in to a different package of your choice. For example, views.trans package.
- Open View Object's Java file, generate if you don't have it and implement beforeRollback and afterRollback methods as shown below.
No comments:
Post a Comment