use of org.eclipse.persistence.jpa.jpql.parser.TypeExpression in project eclipselink by eclipse-ee4j.
the class ReportItemBuilder method visit.
@Override
public void visit(TypeExpression expression) {
Expression queryExpression = queryContext.buildExpression(expression, type);
addAttribute(ExpressionTools.EMPTY_STRING, queryExpression);
}
use of org.eclipse.persistence.jpa.jpql.parser.TypeExpression in project eclipselink by eclipse-ee4j.
the class AbstractSemanticValidator method validateTypeExpression.
/**
* Validates the given {@link TypeExpression}. The test to perform is:
* <ul>
* <li>If the encapsulated expression is a path expression, validation makes sure it is an
* association field, a basic field is not allowed.</li>
* </ul>
*
* @param expression The {@link TypeExpression} to validate
* @return <code>false</code> if the encapsulated expression was validated and is invalid;
* <code>true</code> otherwise
*/
protected boolean validateTypeExpression(TypeExpression expression) {
// Validate the expression
if (expression.hasEncapsulatedExpression()) {
Expression encapsulatedExpression = expression.getExpression();
// Special case for state field path expression, only association field is allowed
StateFieldPathExpression pathExpression = getStateFieldPathExpression(encapsulatedExpression);
if (pathExpression != null) {
return validateStateFieldPathExpression(pathExpression, PathType.ASSOCIATION_FIELD_ONLY);
} else {
encapsulatedExpression.accept(this);
}
}
return true;
}
Aggregations