I recently posted ADF BC: Using Groovy to fetch sequence numbers for EO/VO attribute default values. This post showed the power of what you can get away with in the new Groovy expressions of ADF Business Components in JDeveloper 11g.
Though power is good (muhahaha!, um, cough), simple is better.
Steve Muench suggested the following to make retrieving sequence numbers a breeze via the Groovy expression facilities.
Readers will be familiar with the common recommendation for ADF Business Components to create a layer of framework extensions, as per Section 33.2 of the JDeveloper 11g Fusion Guide.
With this in mind we can create the following helper method seqNextVal() to fetch the next value for a named sequence in our custom EntityImpl:
...which we can then make use of in our Groovy expression in the Entity Object attribute's default value field:
Remember to set the Value Type = Expression.
Thanks to Steve for his suggestion.
Friday, March 20
ADF BC: Using Groovy to fetch sequence numbers Part II
Labels: ADF Business Components
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment