Overriding bindParametersForCollection() to set a view object bind variable

There are times when you need to programmatically set the value of a bind variable used in the view object query. One way to accomplish this task is by overriding the view object method bindParametersForCollection() and explicitly specifying the value for the particular bind variable. This technique comes handy when the bind variable values cannot be specified in a declarative way, or the bind variable value source changes dynamically at runtime.

This recipe will show how to provide a default value for a bind variable used in the view object query if a value has not already been specified for it.

Getting ready

You will need to have access to the shared components workspace ...

Get Oracle JDeveloper 11gR2 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.