Armando
Armando

Reputation: 5

How to change whole SQL Query in same View Object? ADF Oracle

I have one View Object that has already defined its SQLQuery inside XML file.

Select name from EMPLOYEES;

But due to business requirements I need to replace the whole SQL Query dinamically to.

Select name from Country where name in (select name from Places where tops = '10');

I have implemented the View Object Impl class and I have been reading about setQuery method but not sure how to do it and where (which method or part of the lifecycle process use it.

Upvotes: 0

Views: 240

Answers (1)

Timo Hahn
Timo Hahn

Reputation: 2496

You can do this by using createViewObjectFromQueryStmt(...) method of a view object.

you should take a look at this video about dynamic components and how they could be used.

Keep in mind that once you changed a VO this way, the query remains until you do another change.

Upvotes: 0

Related Questions