use of org.eclipse.persistence.jpa.jpql.parser.FunctionExpression in project eclipselink by eclipse-ee4j.
the class ReportItemBuilder method visit.
@Override
public void visit(FunctionExpression expression) {
Expression queryExpression = queryContext.buildExpression(expression, type);
addAttribute(ExpressionTools.EMPTY_STRING, queryExpression);
}
use of org.eclipse.persistence.jpa.jpql.parser.FunctionExpression in project eclipselink by eclipse-ee4j.
the class AbstractActualJPQLQueryFormatter method visit.
@Override
public void visit(FunctionExpressionStateObject stateObject) {
if (stateObject.isDecorated()) {
toText(stateObject);
} else {
FunctionExpression expression = stateObject.getExpression();
// FUNC
appendIdentifier((expression != null) ? expression.getActualIdentifier() : FUNC, FUNC);
// (
if (shouldOutput(expression) || expression.hasLeftParenthesis()) {
writer.append(LEFT_PARENTHESIS);
} else if (exactMatch && expression.hasSpaceAfterIdentifier()) {
writer.append(SPACE);
}
// Function name
if (stateObject.hasFunctionName()) {
writer.append(stateObject.getQuotedFunctionName());
if (shouldOutput(expression) || expression.hasComma()) {
writer.append(COMMA);
}
if (shouldOutput(expression) || expression.hasSpaceAfterComma()) {
writer.append(SPACE);
}
}
// Arguments
toStringChildren(stateObject, true);
// )
if (shouldOutput(expression) || expression.hasRightParenthesis()) {
writer.append(RIGHT_PARENTHESIS);
}
}
}
Aggregations