The DISTINCT keyword is used to specify that duplicate values must be eliminated from the query result. If DISTINCT is not specified, duplicate values are not eliminated. Stand-alone identification variables in the SELECT clause may optionally be qualified by the OBJECT operator. The SELECT clause must not use the OBJECT operator to qualify path expressions.
SelectClause, SimpleSelectClause
| Modifier and Type | Field and Description |
|---|---|
| private String | distinctIdentifier
The actual DISTINCT identifier found in the string representation of the JPQL query. |
| private boolean | hasSpaceAfterDistinct
Determines whether a whitespace was parsed after the DISTINCT. |
| private boolean | hasSpaceAfterSelect
Determines whether a whitespace was parsed after the SELECT. |
| private String | identifier
The actual identifier found in the string representation of the JPQL query. |
| private AbstractExpression | selectExpression
The actual expression of this select clause. |
| Access | Constructor and Description |
|---|---|
| protected | AbstractSelectClause(AbstractExpression
The parent of this expression parent)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| 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 CollectionExpression | Returns: The single select item represented by a temporary collectionCreates a new |
| 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 final String | Returns: The DISTINCT identifier that was actually parsed, or an empty string if it was not parsedReturns the actual DISTINCT identifier found in the string representation of the JPQL query, which has the actual case that was used. |
| public final String | Returns: The SELECT identifier that was actually parsedReturns the actual SELECT identifier found in the string representation of the JPQL query, which has the actual case that was used. |
| public final Expression | Returns: The expression representing the select itemsReturns the |
| public abstract String | Returns: The ID of the query BNF for the list of select items to parseReturns the unique identifier of the |
| public final boolean | Returns: true if the identifier DISTINCT was parsed;
false otherwiseDetermines whether the identifier DISTINCT was parsed or not. |
| public final boolean | Returns: true the list of select items was parsed;
false otherwiseDetermines whether the list of select items was parsed. |
| public final boolean | Returns: true if there was a whitespace after DISTINCT;
false otherwiseDetermines whether a whitespace was parsed after DISTINCT. |
| public final boolean | Returns: true if there was a whitespace after SELECT;
false otherwiseDetermines whether a whitespace was parsed after SELECT. |
| 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 boolean | shouldSkipLiteral(AbstractExpression
The expression)Expression that has just been parsed or nullOverrides org. |
| 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.
|
| distinctIdentifier | back to summary |
|---|---|
| private String distinctIdentifier The actual DISTINCT identifier found in the string representation of the JPQL query. | |
| hasSpaceAfterDistinct | back to summary |
|---|---|
| private boolean hasSpaceAfterDistinct Determines whether a whitespace was parsed after the DISTINCT. | |
| hasSpaceAfterSelect | back to summary |
|---|---|
| private boolean hasSpaceAfterSelect Determines whether a whitespace was parsed after the SELECT. | |
| identifier | back to summary |
|---|---|
| private String identifier The actual identifier found in the string representation of the JPQL query. | |
| selectExpression | back to summary |
|---|---|
| private AbstractExpression selectExpression The actual expression of this select clause. | |
| AbstractSelectClause | back to summary |
|---|---|
| protected AbstractSelectClause(AbstractExpression parent) Creates a new
| |
| 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
| |
| buildCollectionExpression | back to summary |
|---|---|
| public CollectionExpression buildCollectionExpression() Creates a new
| |
| findQueryBNF | back to summary |
|---|---|
| public JPQLQueryBNF findQueryBNF(Expression expression) Overrides org. Implements org. Doc from org. Retrieves the
| |
| getActualDistinctIdentifier | back to summary |
|---|---|
| public final String getActualDistinctIdentifier() Returns the actual DISTINCT identifier found in the string representation of the JPQL query, which has the actual case that was used.
| |
| getActualIdentifier | back to summary |
|---|---|
| public final String getActualIdentifier() Returns the actual SELECT identifier found in the string representation of the JPQL query, which has the actual case that was used.
| |
| getSelectExpression | back to summary |
|---|---|
| public final Expression getSelectExpression() Returns the
| |
| getSelectItemQueryBNFId | back to summary |
|---|---|
| public abstract String getSelectItemQueryBNFId() Returns the unique identifier of the
| |
| hasDistinct | back to summary |
|---|---|
| public final boolean hasDistinct() Determines whether the identifier DISTINCT was parsed or not.
| |
| hasSelectExpression | back to summary |
|---|---|
| public final boolean hasSelectExpression() Determines whether the list of select items was parsed.
| |
| hasSpaceAfterDistinct | back to summary |
|---|---|
| public final boolean hasSpaceAfterDistinct() Determines whether a whitespace was parsed after DISTINCT.
| |
| hasSpaceAfterSelect | back to summary |
|---|---|
| public final boolean hasSpaceAfterSelect() Determines whether a whitespace was parsed after SELECT.
| |
| 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
| |
| shouldSkipLiteral | back to summary |
|---|---|
| protected boolean shouldSkipLiteral(AbstractExpression expression) Overrides org. Doc from org. When parsing an invalid or incomplete query, it is possible two literals would be parsed but in some cases, a CollectionExpression should not be created and the parsing should actually stop here. Example: BETWEEN 10 20, when parsing 20, it should not be parsed as part of the lower bound expression.
| |
| toParsedText | back to summary |
|---|---|
| protected void toParsedText(StringBuilder writer, boolean actual) Implements abstract org. Doc from org. Generates a string representation of this
| |