use of org.eclipse.persistence.jpa.jpql.parser.EmptyCollectionComparisonExpression in project eclipselink by eclipse-ee4j.
the class AbstractGrammarValidator method visit.
@Override
public void visit(EmptyCollectionComparisonExpression expression) {
// Missing collection valued path expression
if (!expression.hasExpression()) {
int startPosition = position(expression);
addProblem(expression, startPosition, EmptyCollectionComparisonExpression_MissingExpression);
} else {
Expression pathExpression = expression.getExpression();
// The expression is not a path expression
if (!isValid(pathExpression, CollectionValuedPathExpressionBNF.ID)) {
int startPosition = position(expression);
int endPosition = startPosition + length(pathExpression);
addProblem(expression, startPosition, endPosition, CollectionValuedPathExpression_NotCollectionType, expression.toParsedText());
} else {
super.visit(expression);
}
}
}
use of org.eclipse.persistence.jpa.jpql.parser.EmptyCollectionComparisonExpression in project eclipselink by eclipse-ee4j.
the class AbstractActualJPQLQueryFormatter method visit.
@Override
public void visit(EmptyCollectionComparisonExpressionStateObject stateObject) {
if (stateObject.isDecorated()) {
toText(stateObject);
} else {
EmptyCollectionComparisonExpression expression = stateObject.getExpression();
stateObject.getStateObject().accept(this);
writer.append(SPACE);
// 'IS'
appendIdentifier((expression != null) ? expression.getActualIsIdentifier() : IS, IS);
writer.append(SPACE);
// 'NOT'
if (stateObject.hasNot()) {
appendIdentifier((expression != null) ? expression.getActualNotIdentifier() : NOT, NOT);
writer.append(SPACE);
}
// 'EMPTY'
appendIdentifier((expression != null) ? expression.getActualEmptyIdentifier() : EMPTY, EMPTY);
}
}
Aggregations