All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cds.jdbc.generic.GenericPredicateModifier Maven / Gradle / Ivy

There is a newer version: 3.6.1
Show newest version
/************************************************************************
 * © 2020-2023 SAP SE or an SAP affiliate company. All rights reserved. *
 ************************************************************************/
package com.sap.cds.jdbc.generic;

import com.sap.cds.ql.CQL;
import com.sap.cds.ql.Value;
import com.sap.cds.ql.cqn.CqnComparisonPredicate.Operator;
import com.sap.cds.ql.cqn.CqnPredicate;
import com.sap.cds.ql.cqn.Modifier;
import com.sap.cds.util.CqnStatementUtils;

public class GenericPredicateModifier implements Modifier {
	@Override
	public CqnPredicate comparison(Value lhs, Operator op, Value rhs) {
		switch (op) {
			case IS:
			case IS_NOT:
				CqnPredicate unfolded = CqnStatementUtils.unfold(CQL.comparison(lhs, op, rhs));
				return CQL.copy(unfolded, new UnfoldIsOperatorModifier());
			default:
				return CQL.comparison(lhs, op, rhs);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy