You can download the sample workspace from here
[Runs with Oracle JDeveloper 184.108.40.206.0 (11g R2) + HR Schema]
Create Fusion Web Application with entities based on Departments, then create a session bean and data control for the session bean.
First create the table required for @TableGenerator, download the required sql script.
Steps to configure @TableGenerator
- Right click on the Connection and select New -> Offline Database Objects -> Offline Database Objects from Source Database, select Sequence table and click on Finish.
- Open persistence.xml in flat editor.
- Navigate to Departments Entity from persistence.xml and open departmentId field.
- Go to Primary Key Generation Tab select Table Generator section.
- Make the configuration as shown in below image.
Now select Use Generated Value check box and set the Strategy as Table and Generator as DeptNoGenerator as shown below.