Saturday, June 28, 2014

ADF 12c ( - View Object Declarative Mode is Default

Important event for ADF community - new release of ADF 12c ( Quite many new features overall in the framework and there are some related to ADF BC. I will focus on ADF BC and highlight one new feature, which I think is very important to know. This is related to ADF BC VO mode, from now on - Declarative VO mode is a default. There is no longer Expert mode, this is renamed to Custom SQL and overall wizard for VO Query is changed. Read more about it in developer guide - 5.3 Working with View Objects in Declarative SQL Mode.

Every time when creating VO based on EO, JDeveloper will generate VO with Declarative mode:

This is how VO Query wizard looks like now. VO Query is declarative and will be generated on runtime. Although, it doesn't mean all attributes will be checked dynamically by default. On opposite, all attributes by default will be included into generated query:

Option 'Calculate Optimized Query at Runtime' is selected by default, this means Declarative mode is on. List of attributes is displayed, these attributes will be always included into SQL query. If we want to exclude some of them, we need to set Selected in Query = false for the attribute:

In sample application, I'm going to set this property to be false for all attributes, except a key:

If we return back to the VO Query wizard screen, now only key attribute remains selected:

UI is developed to display six attributes:

Only displayed attributes are included into SQL statement:

Download sample application -


Florin Marcus said...

View Object's Declarative Mode gets the spotlight, after all this time.

Andrej Baranovskij said...

Yes, quite cool !

Anonymous said...

What about a custom ORDER BY UPPER(XXX) in declarative mode?

Andrej Baranovskij said...

Not sure you can use it in declarative mode, switch to normal mode.


Unknown said...

Neat trick: query's OrderBy UPPER(XXX) in declarative mode can be achieved by altering manually the .xml source file first: the visual mode will only allow to shuttle TABLE.COLUMN definitions (and complain when modifying those). It seems fine with it after the done so modification. Let me know what do you think of it. (using DB driven columns in here, btw)

Andrej Baranovskij said...

This sounds like a good trick.

saurabh said...

I created a VC in 12c. i have check show match all and match any checkbox so it gives me option to do search operation either ways. But if I am selecting already entered value using key board
arrow key and click on then all the fields becomes mandatory though Any mode radio button is selected.