I am looking for guidance on setting up my Entity Object. I am working with an existing db where the primary keys for the tables ( ID Number(10,0) ) is populated by a trigger on insert. Should the attribute type for the ID column be Integer or DBSequence? I originally set it up as DBSequence but when I perform a CreateInsert() on the form, populate values, then Commit(), the ID value is not populated in the form. I put a ppr on the form also. I can see the row in the db using sqlDeveloper and it is populated. I tried turning on the "refresh after insert" flag on the entity but then received the exception "JBO-28203: The updated row cannot be refreshed because its key values are unset or modified by database triggers.". I would like the ID so after the form is saved I can refresh a tree control and set the current row to the new row.
Have you setup the entity like described in the doc http://docs.oracle.com/cd/E28280_01/web.1111/b31974/bcentities.htm#BABBHCHI ?
From the doc it looks like the refresh after insert should be checked automatically.
Thank you for the reply. I read the doc and that is how I had it setup originally. Two things I noticed when going to check the settings was that DBSequence was not available as a data type so I needed to Browse.. to select it. The 2nd thing was that the refresh on create was not automatically selected after selecting DBSequence. I searched a bit more and found this forum discussion: auto_increment field From that discussion I see my problem. I created my EO's using SQL92 and Java because I need to support both Oracle and MSSQL Server databases.
This is unfortunate from my end so I will see if I can implement something similar to what is suggested in that post.