18 package com.mysql.clusterj.jdbc.antlr.node;
20 import org.antlr.runtime.Token;
21 import org.antlr.runtime.tree.Tree;
23 import com.mysql.clusterj.jdbc.antlr.MySQL51Parser;
24 import com.mysql.clusterj.query.Predicate;
25 import com.mysql.clusterj.query.QueryDomainType;
31 setNumberOfParameters(2);
36 setNumberOfParameters(2);
45 public Predicate getPredicate(QueryDomainType<?> queryDomainType) {
47 String propertyName = null;
48 String leftParameterName = getParameterName(1);
49 String rightParameterName = getParameterName(2);
50 if (getChild(0).getType() == MySQL51Parser.NOT) {
52 propertyName = getChild(0)
56 result = queryDomainType.
not(queryDomainType.get(propertyName)
57 .between(queryDomainType.param(leftParameterName), queryDomainType.param(rightParameterName)));
59 propertyName = getPropertyName();
60 result = queryDomainType.get(propertyName)
61 .between(queryDomainType.param(leftParameterName), queryDomainType.param(rightParameterName));
63 Tree lowerBound = getChild(1);
64 Tree upperBound = getChild(2);
65 if (logger.isDetailEnabled()) logger.detail(
"propertyName: " + propertyName
66 +
" lowerBound: " + lowerBound.getText()
67 +
" upperBound: " + upperBound.getText());