The results of the subquery must be like the same abstract schema type of the state field path expression in type.
There must be at least one element in the comma separated list that defines the set of values for the IN expression. If the value of a state field path expression in an IN or NOT IN expression is NULL or unknown, the value of the expression is unknown.
JPA 1.0:
in_expression ::= state_field_path_expression [NOT] IN(in_item {, in_item}* | subquery)in_expression ::= {state_field_path_expression | type_discriminator} [NOT] IN { ( in_item {, in_item}* ) | (subquery) | collection_valued_input_parameter }EclipseLink 2.1:
in_item ::= literal | single_valued_input_parameter | scalar_expressionEclipseLink 2.5:
in_expression ::= { in_expression_expression | nested_array_expression } [NOT] IN { ( in_item {, in_item}* ) | (subquery) | ( nested_array_item {, nested_array_item}+ ) | collection_valued_input_parameter }
in_expression_expression ::= { state_field_path_expression | type_discriminator |
single_valued_input_parameter | identification_variable |
scalar_expression }
nested_array_expression ::= ( in_expression_expression {, in_expression_expression}+ )
nested_array_item ::= ( in_item {, in_item}+ )SELECT c FROM Customer c WHERE c.home.city IN :citySELECT p FROM Project p WHERE TYPE(p) IN(LargeProject, SmallProject)| Modifier and Type | Field and Description |
|---|---|
| private AbstractExpression | expression
The expression before the 'IN' identifier used for identification. |
| private boolean | hasLeftParenthesis
Flag used to determine if the closing parenthesis is present in the query. |
| private boolean | hasRightParenthesis
Flag used to determine if the opening parenthesis is present in the query. |
| private boolean | hasSpaceAfterIn
Flag used to determine if a space was parsed after |
| private String | inIdentifier
The actual IN identifier found in the string representation of the JPQL query. |
| private AbstractExpression | inItems
The expression within parenthesis, which can be one or many expressions. |
| private String | notIdentifier
The actual NOT identifier found in the string representation of the JPQL query. |
| private Boolean | singleInputParameter
Determines whether what was parsed after the |
| Access | Constructor and Description |
|---|---|
| public | InExpression(AbstractExpression
The parent of this expression parent, AbstractExpression The state field path expression that was parsed prior of parsing this
expression expression)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(ExpressionVisitor
The visitor)ExpressionVisitor to visit this objectImplements org. Expression by the given visitor.
|
| public void | acceptChildren(ExpressionVisitor
The visitor)visitor to visit the children of this object.Implements org. Expression.
|
| protected void | addChildrenTo(Collection<Expression>
The collection used to store the children children)Overrides org. AbstractExpression to the given collection.
|
| protected void | addOrderedChildrenTo(List<Expression>
The list used to store the string representation of this children)AbstractExpressionOverrides org. AbstractExpression to the given list.
|
| public JPQLQueryBNF | findQueryBNF(Expression
The expression)Expression that is a descendant of this oneOverrides org. Implements org. JPQLQueryBNF that represents the fragment of this Expression
that was used when parsing the given Expression.
|
| public String | Returns: The IN identifier that was actually parsedReturns the actual IN found in the string representation of the JPQL query, which has the actual case that was used. |
| public String | Returns: The NOT identifier that was actually parsed, or an empty string if it was not parsedReturns the actual NOT found in the string representation of the JPQL query, which has the actual case that was used. |
| public Expression | Returns: The expression that was parsed representing the state field path expression or the type discriminatorReturns the |
| public String | Returns: InExpressionExpressionBNF#IDReturns the unique identifier of the query BNF that describes the expression being tested by
the |
| public String | Returns: InExpressionItemBNF#IDReturns the unique identifier of the query BNF that describes the items being tested against. |
| public String | |
| public Expression | Returns: The expression that was parsed representing the list of itemsReturns the |
| public JPQLQueryBNF | getQueryBNF()
Implements org. Expression.
|
| public boolean | Returns: true if the state field path expression or type discriminator was parsed;
false if it was not parsedDetermines whether the state field path expression or type discriminator was parsed. |
| public boolean | Returns: true if at least one item was parsed; false otherwiseDetermines whether the list of items was parsed. |
| public boolean | Returns: true if the open parenthesis was present in the string version of the
query; false otherwiseDetermines whether the open parenthesis was parsed or not. |
| public boolean | Returns: true if the identifier NOT was parsed; false otherwiseDetermines whether the identifier NOT was parsed. |
| public boolean | Returns: true if the close parenthesis was present in the string version of the
query; false otherwiseDetermines whether the close parenthesis was parsed or not. |
| public boolean | Returns: true if a whitespace was parsed after IN in the string
version of the query; false otherwiseDetermines whether there was a whitespace after the |
| protected boolean | isParsingComplete(WordParser
The text to parse based on the current position of the cursor wordParser, String The word that was retrieved from the given text, which is the first word in the text word, Expression The expression)Expression that has already been parsedOverrides org. |
| public boolean | Returns: true if what is following the IN identifier is a single
input parameter (without the left or right parenthesis); false otherwiseDetermines whether what was parsed after the BNF:
in_expression ::= {state_field_path_expression | type_discriminator} [NOT] IN collection_valued_input_parameter |
| protected void | parse(WordParser
The text to parse based on the current position of the cursor wordParser, boolean Determines whether the parsing system should be tolerant, meaning if it should
try to parse invalid or incomplete queries tolerant)Implements abstract org. WordParser.
|
| protected void | toParsedText(StringBuilder
The buffer used to append this writer, boolean Expression's string representationDetermines whether the string representation should represent what was parsed,
i.e. include any "virtual" whitespace (such as ending whitespace) and the actual case of the
JPQL identifiers actual)Implements abstract org. Expression, including its children,
if it has any.
|
| expression | back to summary |
|---|---|
| private AbstractExpression expression The expression before the 'IN' identifier used for identification. | |
| hasLeftParenthesis | back to summary |
|---|---|
| private boolean hasLeftParenthesis Flag used to determine if the closing parenthesis is present in the query. | |
| hasRightParenthesis | back to summary |
|---|---|
| private boolean hasRightParenthesis Flag used to determine if the opening parenthesis is present in the query. | |
| hasSpaceAfterIn | back to summary |
|---|---|
| private boolean hasSpaceAfterIn Flag used to determine if a space was parsed after | |
| inIdentifier | back to summary |
|---|---|
| private String inIdentifier The actual IN identifier found in the string representation of the JPQL query. | |
| inItems | back to summary |
|---|---|
| private AbstractExpression inItems The expression within parenthesis, which can be one or many expressions. | |
| notIdentifier | back to summary |
|---|---|
| private String notIdentifier The actual NOT identifier found in the string representation of the JPQL query. | |
| singleInputParameter | back to summary |
|---|---|
| private Boolean singleInputParameter Determines whether what was parsed after the | |
| InExpression | back to summary |
|---|---|
| public InExpression(AbstractExpression parent, AbstractExpression expression) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(ExpressionVisitor visitor) Implements org. Doc from org. Visits this
| |
| acceptChildren | back to summary |
|---|---|
| public void acceptChildren(ExpressionVisitor visitor) Implements org. Doc from org. Visits the children of this
This does not traverse the
| |
| addChildrenTo | back to summary |
|---|---|
| protected void addChildrenTo(Collection<Expression> children) Overrides org. Doc from org. Adds the children of this
| |
| addOrderedChildrenTo | back to summary |
|---|---|
| protected void addOrderedChildrenTo(List<Expression> children) Overrides org. Doc from org. Adds the children of this
| |
| findQueryBNF | back to summary |
|---|---|
| public JPQLQueryBNF findQueryBNF(Expression expression) Overrides org. Implements org. Doc from org. Retrieves the
| |
| getActualInIdentifier | back to summary |
|---|---|
| public String getActualInIdentifier() Returns the actual IN found in the string representation of the JPQL query, which has the actual case that was used.
| |
| getActualNotIdentifier | back to summary |
|---|---|
| public String getActualNotIdentifier() Returns the actual NOT found in the string representation of the JPQL query, which has the actual case that was used.
| |
| getExpression | back to summary |
|---|---|
| public Expression getExpression() Returns the
| |
| getExpressionExpressionQueryBNFId | back to summary |
|---|---|
| public String getExpressionExpressionQueryBNFId() Returns the unique identifier of the query BNF that describes the expression being tested by
the | |
| getExpressionItemQueryBNFId | back to summary |
|---|---|
| public String getExpressionItemQueryBNFId() Returns the unique identifier of the query BNF that describes the items being tested against.
| |
| getIdentifier | back to summary |
|---|---|
| public String getIdentifier() Returns the identifier for this expression.
| |
| getInItems | back to summary |
|---|---|
| public Expression getInItems() Returns the
| |
| getQueryBNF | back to summary |
|---|---|
| public JPQLQueryBNF getQueryBNF() Implements org. Doc from org. Returns the BNF of this
| |
| hasExpression | back to summary |
|---|---|
| public boolean hasExpression() Determines whether the state field path expression or type discriminator was parsed.
| |
| hasInItems | back to summary |
|---|---|
| public boolean hasInItems() Determines whether the list of items was parsed.
| |
| hasLeftParenthesis | back to summary |
|---|---|
| public boolean hasLeftParenthesis() Determines whether the open parenthesis was parsed or not.
| |
| hasNot | back to summary |
|---|---|
| public boolean hasNot() Determines whether the identifier NOT was parsed.
| |
| hasRightParenthesis | back to summary |
|---|---|
| public boolean hasRightParenthesis() Determines whether the close parenthesis was parsed or not.
| |
| hasSpaceAfterIn | back to summary |
|---|---|
| public boolean hasSpaceAfterIn() Determines whether there was a whitespace after the
| |
| isParsingComplete | back to summary |
|---|---|
| protected boolean isParsingComplete(WordParser wordParser, String word, Expression expression) Overrides org. Doc from org. Determines whether the parsing is complete based on what is left in the given text. The text is never empty.
| |
| isSingleInputParameter | back to summary |
|---|---|
| public boolean isSingleInputParameter() Determines whether what was parsed after the BNF:
in_expression ::= {state_field_path_expression | type_discriminator} [NOT] IN collection_valued_input_parameter
| |
| parse | back to summary |
|---|---|
| protected void parse(WordParser wordParser, boolean tolerant) Implements abstract org. Doc from org. Parses the query by starting at the current position, which is part of the given
| |
| toParsedText | back to summary |
|---|---|
| protected void toParsedText(StringBuilder writer, boolean actual) Implements abstract org. Doc from org. Generates a string representation of this
| |