WAS v8.5 > Develop applications > Develop Dynamic and EJB query > Develop applications that use EJB query > EJB query languageWHERE clause
The WHERE clause lists search conditions for items to add to a result set.
The WHERE clause contains search conditions composed of the following:
- literal values
- input parameters
- expressions
- basic predicates
- quantified predicates
- BETWEEN predicate
- IN predicate
- LIKE predicate
- NULL predicate
- EMPTY collection predicate
- MEMBER OF predicate
- EXISTS predicate
- IS OF TYPE predicate
If the search condition evaluates to TRUE, the tuple is added to the result set.
Subtopics
- Literals
Literals can be considered constants that do not change in value.- Input parameters
Input parameters are designated by the question mark followed by a number; for example: ?2. Input parameters are numbered starting at 1 and correspond to the arguments of the finder or select method; therefore, a query must not contain an input parameter that exceeds the number of input arguments.- WAS, Expressions
An expression specifies a value.- Basic predicates
A basic predicate compares two values.- Quantified predicates
A quantified predicate compares a value with a set of values produced by a subselect.- BETWEEN predicate
The BETWEEN predicate determines whether a given value lies between two other given values.- IN predicate
The IN predicate compares a value to a set of values.- LIKE predicate
The LIKE predicate searches a string value for a certain pattern.- NULL predicate
The NULL predicate tests for null values.- EMPTY collection predicate
We can use the EMPTY collection predicate to test if a multivalued relationship has no members.- MEMBER OF predicate
This expression tests whether the object reference specified by the single valued path expression or input parameter is a member of the designated collection.- EXISTS predicate
The exists predicate tests for the presence or absence of a condition specified by a subselect.- IS OF TYPE predicate
The IS OF TYPE predicate is used to test the type of an EJB reference. It is similar in function to the Java instance of operator.- Literals
Literals can be considered constants that do not change in value.- Input parameters
Input parameters are designated by the question mark followed by a number; for example: ?2. Input parameters are numbered starting at 1 and correspond to the arguments of the finder or select method; therefore, a query must not contain an input parameter that exceeds the number of input arguments.- WAS, Expressions
An expression specifies a value.- Basic predicates
A basic predicate compares two values.- Quantified predicates
A quantified predicate compares a value with a set of values produced by a subselect.- BETWEEN predicate
The BETWEEN predicate determines whether a given value lies between two other given values.- IN predicate
The IN predicate compares a value to a set of values.- LIKE predicate
The LIKE predicate searches a string value for a certain pattern.- NULL predicate
The NULL predicate tests for null values.- EMPTY collection predicate
We can use the EMPTY collection predicate to test if a multivalued relationship has no members.- MEMBER OF predicate
This expression tests whether the object reference specified by the single valued path expression or input parameter is a member of the designated collection.- EXISTS predicate
The exists predicate tests for the presence or absence of a condition specified by a subselect.- IS OF TYPE predicate
The IS OF TYPE predicate is used to test the type of an EJB reference. It is similar in function to the Java instance of operator.
Related concepts:
EJB query language
Related
Use EJB query