Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Wednesday, August 12, 2009

Using Groovy to populate sequence value in primary key attribute in ADF 11g

In ADF 11g there is a better and much simpler way to populated primary key attribute of your entity using a db sequence.

You can simply to to your entity pk attribute change the default value type to expression and put

(new oracle.jbo.server.SequenceImpl("YOUR_SEQ_NAME",object.getDBTransaction())).getSequenceNumber()

and

1 comment:

John Stegeman said...

Hi Vik,

Here is yet another way: http://forums.oracle.com/forums/messageview.jspa?messageID=3774998

Well, it's not really a way yet, but it's quite an easy task, I believe, to implement, even if its not within the base capability of ADF yet.

John