DATAJDBC-478 - Expose arguments of SimpleCondition and SimpleFunction.

We now allow introspection by exposing the arguments as function arguments and the condition expression could be subject to mapping metadata mapping.
This commit is contained in:
Mark Paluch
2020-01-28 14:15:15 +01:00
parent 36b419e712
commit 6825a64d56
2 changed files with 23 additions and 0 deletions

View File

@@ -50,10 +50,24 @@ public class SimpleCondition extends AbstractSegment implements Condition {
return new SimpleCondition(new Column(column, null), comparator, predicate);
}
/**
* @return the condition expression (left-hand-side)
* @since 2.0
*/
public Expression getExpression() {
return expression;
}
/**
* @return the comparator.
*/
public String getComparator() {
return comparator;
}
/**
* @return the condition predicate (right-hand-side)
*/
public String getPredicate() {
return predicate;
}

View File

@@ -15,6 +15,7 @@
*/
package org.springframework.data.relational.core.sql;
import java.util.Collections;
import java.util.List;
import org.springframework.util.Assert;
@@ -74,6 +75,14 @@ public class SimpleFunction extends AbstractSegment implements Expression {
return functionName;
}
/**
* @return the function arguments.
* @since 2.0
*/
public List<Expression> getExpressions() {
return Collections.unmodifiableList(expressions);
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()