Limiting large view object query result sets by using required view criteria
In the recipe Limiting large view object query result sets in this chapter, we presented a programmatic technique to limit the result set produced by a view object query. A simpler way to accomplish this in a declarative manner is to add named view criteria to the view object ensuring that some of the criteria items are required. This will force the user at runtime to enter values for those required criteria, thus limiting the size of the query result set.
In this recipe, we will add named view criteria to a view object and make the criteria items required.
Getting ready
We will add named view criteria to the Employees
view object. It is part of the HRComponents
workspace, which was created in Overriding remove() to delete associated children entities, Chapter 2,Dealing with Basics: Entity Objects.
The HRComponents
workspace requires a database connection to the HR
schema.
How to do it…
1. Open the
HRComponents
workspace...