use of org.apache.cayenne.access.sqlbuilder.sqltree.ValueNode in project cayenne by apache.
the class FirebirdSQLTreeProcessor method newSliceNode.
private InNode newSliceNode(InNode child, Node arg, ValueNode valueNode, Object slice) {
InNode nextNode = new InNode(child.isNot());
nextNode.addChild(arg.deepCopy());
nextNode.addChild(new ValueNode(slice, valueNode.isArray(), valueNode.getAttribute()));
return nextNode;
}
use of org.apache.cayenne.access.sqlbuilder.sqltree.ValueNode in project cayenne by apache.
the class QualifierTranslationStageTest method perform.
@Test
public void perform() {
QualifierTranslationStage stage = new QualifierTranslationStage();
stage.perform(context);
assertNotNull(context.getQualifierNode());
// Content of "Qualifier" node:
//
// OpExpression
// / \
// Column Value
Node op = context.getQualifierNode();
assertThat(op, instanceOf(OpExpressionNode.class));
assertEquals(">=", ((OpExpressionNode) op).getOp());
assertEquals(2, op.getChildrenCount());
assertThat(op.getChild(0), instanceOf(ColumnNode.class));
assertThat(op.getChild(1), instanceOf(ValueNode.class));
ColumnNode columnNode = (ColumnNode) op.getChild(0);
ValueNode valueNode = (ValueNode) op.getChild(1);
assertEquals("path", columnNode.getColumn());
assertEquals(10, valueNode.getValue());
}
Aggregations