use of org.teiid.query.sql.symbol.Expression in project teiid by teiid.
the class CompareCriteria method clone.
/**
* Deep copy of object
* @return Deep copy of object
*/
public Object clone() {
Expression leftCopy = null;
if (getLeftExpression() != null) {
leftCopy = (Expression) getLeftExpression().clone();
}
Expression rightCopy = null;
if (getRightExpression() != null) {
rightCopy = (Expression) getRightExpression().clone();
}
CompareCriteria result = new CompareCriteria(leftCopy, getOperator(), rightCopy);
result.isOptional = isOptional;
return result;
}
use of org.teiid.query.sql.symbol.Expression in project teiid by teiid.
the class DependentSetCriteria method clone.
/**
* Deep copy of object. The values iterator source of this object
* will not be cloned - it will be passed over as is and shared with
* the original object, just like Reference.
* @return Deep copy of object
*/
public DependentSetCriteria clone() {
Expression copy = null;
if (getExpression() != null) {
copy = (Expression) getExpression().clone();
}
DependentSetCriteria criteriaCopy = new DependentSetCriteria(copy, id);
if (this.valueExpression != null) {
criteriaCopy.setValueExpression((Expression) getValueExpression().clone());
}
criteriaCopy.id = this.id;
criteriaCopy.ndv = this.ndv;
criteriaCopy.maxNdv = this.maxNdv;
criteriaCopy.maxNdvs = this.maxNdvs;
criteriaCopy.ndvs = this.ndvs;
criteriaCopy.makeDepOptions = this.makeDepOptions;
return criteriaCopy;
}
use of org.teiid.query.sql.symbol.Expression in project teiid by teiid.
the class MatchCriteria method clone.
/**
* Deep copy of object
* @return Deep copy of object
*/
public Object clone() {
Expression leftCopy = null;
if (getLeftExpression() != null) {
leftCopy = (Expression) getLeftExpression().clone();
}
Expression rightCopy = null;
if (getRightExpression() != null) {
rightCopy = (Expression) getRightExpression().clone();
}
MatchCriteria criteriaCopy = new MatchCriteria(leftCopy, rightCopy, getEscapeChar());
criteriaCopy.setNegated(isNegated());
criteriaCopy.mode = mode;
return criteriaCopy;
}
use of org.teiid.query.sql.symbol.Expression in project teiid by teiid.
the class TestGeometry method testSimplify.
@Test
public void testSimplify() throws Exception {
Expression ex = TestFunctionResolving.getExpression("ST_AsText(ST_SIMPLIFY(ST_GeomFromText('LINESTRING(1 1,2 2,2 3.5,1 3,1 2,2 1)'), 1))");
assertEquals("LINESTRING (1 1, 2 3.5, 2 1)", ClobType.getString((ClobType) Evaluator.evaluate(ex)));
// ensure it creates an empty geometry
ex = TestFunctionResolving.getExpression("ST_ISEmpty(ST_Simplify(ST_GeomFromText('POLYGON((6 3,1 -2,-4 3,1 8,6 3))'),5))");
assertTrue((Boolean) Evaluator.evaluate(ex));
}
use of org.teiid.query.sql.symbol.Expression in project teiid by teiid.
the class TestGeometry method testAsText.
@Test
public void testAsText() throws Exception {
Expression ex2 = TestFunctionResolving.getExpression("st_astext(ST_GeomFromText('POLYGON ((40 0, 50 50, 0 50, 0 0, 40 0))'))");
Clob val = (Clob) Evaluator.evaluate(ex2);
assertEquals("POLYGON ((40 0, 50 50, 0 50, 0 0, 40 0))", ClobType.getString(val));
}
Aggregations