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 ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.