use of org.eclipse.persistence.internal.expressions.SubSelectExpression in project eclipselink by eclipse-ee4j.
the class DescriptorQueryManager method updatePropertyParameterExpression.
/**
* INTERNAL:
* This method will walk the given expression and mark any parameter
* expressions as property expressions. This is done when additional
* criteria has been specified and parameter values must be resolved
* through session properties.
*
* @see #postInitialize
*/
protected void updatePropertyParameterExpression(Expression exp) {
if (exp.isCompoundExpression()) {
updatePropertyParameterExpression(((CompoundExpression) exp).getFirstChild());
updatePropertyParameterExpression(((CompoundExpression) exp).getSecondChild());
} else if (exp.isFunctionExpression()) {
for (Expression e : ((FunctionExpression) exp).getChildren()) {
updatePropertyParameterExpression(e);
}
} else if (exp.isSubSelectExpression()) {
ReportQuery subSelectQuery = ((SubSelectExpression) exp).getSubQuery();
for (ReportItem item : subSelectQuery.getItems()) {
updatePropertyParameterExpression(item.getAttributeExpression());
}
}
if (exp.isParameterExpression()) {
((ParameterExpression) exp).setIsProperty(true);
}
}
use of org.eclipse.persistence.internal.expressions.SubSelectExpression in project eclipselink by eclipse-ee4j.
the class CriteriaBuilderImpl method not.
/**
* Create a negation of the given restriction.
*
* @param restriction
* restriction expression
* @return not predicate
*/
@Override
public Predicate not(Expression<Boolean> restriction) {
if (((InternalExpression) restriction).isPredicate()) {
return ((Predicate) restriction).not();
}
org.eclipse.persistence.expressions.Expression parentNode = null;
List<Expression<?>> compoundExpressions = null;
String name = "not";
if (((InternalExpression) restriction).isCompoundExpression() && ((CompoundExpressionImpl) restriction).getOperation().equals("exists")) {
FunctionExpression exp = (FunctionExpression) ((InternalSelection) restriction).getCurrentNode();
SubSelectExpression sub = (SubSelectExpression) exp.getChildren().get(0);
parentNode = ExpressionOperator.getOperator(ExpressionOperator.NotExists).expressionFor(sub);
name = "notExists";
compoundExpressions = ((CompoundExpressionImpl) restriction).getChildExpressions();
} else {
parentNode = ((InternalSelection) restriction).getCurrentNode().not();
compoundExpressions = buildList(restriction);
}
CompoundExpressionImpl expr = new CompoundExpressionImpl(this.metamodel, parentNode, compoundExpressions, name);
expr.setIsNegated(true);
return expr;
}
Aggregations