Sunday, August 23, 2009

Oracle ADF 11g- Generate values from sequence for a given table.




When creating a database table using JDeveloper 11g (11.1.1.10), select column sequence from left context menu and select the check box for sequence and trigger. (as in given figure)








Generate Business Component for this table and then double click this entity, to view the xml file, click on the attributes link and the select the attribute which generates values from sequence(EmployeeId), make its datatype to be DBSequence (See below image)



Note initially for display the value will be shown as negative but once you commit the record the values will be automatically taken from the sequence.