/** * Constructs an instance of this class from a left and right expression * * @param leftExpression The expression to check * @param rightExpression The match expression */ public MatchCriteria( Expression leftExpression, Expression rightExpression ) { setLeftExpression(leftExpression); setRightExpression(rightExpression); }
/** * Constructs an instance of this class from a left and right expression * * @param leftExpression The expression to check * @param rightExpression The match expression */ public MatchCriteria( Expression leftExpression, Expression rightExpression ) { setLeftExpression(leftExpression); setRightExpression(rightExpression); }
/** * Constructs an instance of this class from a left and right expression * * @param leftExpression The expression to check * @param rightExpression The match expression */ public MatchCriteria( Expression leftExpression, Expression rightExpression ) { setLeftExpression(leftExpression); setRightExpression(rightExpression); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(MatchCriteria) */ public void visit(MatchCriteria obj) { obj.setLeftExpression( replaceExpression(obj.getLeftExpression()) ); obj.setRightExpression( replaceExpression(obj.getRightExpression()) ); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(MatchCriteria) */ public void visit(MatchCriteria obj) { obj.setLeftExpression( replaceExpression(obj.getLeftExpression()) ); obj.setRightExpression( replaceExpression(obj.getRightExpression()) ); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(MatchCriteria) */ public void visit(MatchCriteria obj) { obj.setLeftExpression( replaceExpression(obj.getLeftExpression()) ); obj.setRightExpression( replaceExpression(obj.getRightExpression()) ); }
public static MatchCriteria example(String str) { MatchCriteria crit = new MatchCriteria(); crit.setLeftExpression(new ElementSymbol("m.g1.e1")); //$NON-NLS-1$ crit.setRightExpression(new Constant(str)); return crit; }
public static MatchCriteria example(String element, String str) { MatchCriteria crit = new MatchCriteria(); crit.setLeftExpression(new ElementSymbol(element)); crit.setRightExpression(new Constant(str)); return crit; }
private Criteria rewriteCriteria(MatchCriteria criteria) throws TeiidComponentException, TeiidProcessingException{ criteria.setLeftExpression( rewriteExpressionDirect(criteria.getLeftExpression())); criteria.setRightExpression( rewriteExpressionDirect(criteria.getRightExpression()));
public static MatchCriteria example(String str, char escapeChar) { MatchCriteria crit = new MatchCriteria(); crit.setLeftExpression(new ElementSymbol("m.g1.e1")); //$NON-NLS-1$ crit.setRightExpression(new Constant(str)); crit.setEscapeChar(escapeChar); return crit; }
private Criteria rewriteCriteria(MatchCriteria criteria) throws TeiidComponentException, TeiidProcessingException{ criteria.setLeftExpression( rewriteExpressionDirect(criteria.getLeftExpression())); criteria.setRightExpression( rewriteExpressionDirect(criteria.getRightExpression()));
private Criteria rewriteCriteria(MatchCriteria criteria) throws TeiidComponentException, TeiidProcessingException{ criteria.setLeftExpression( rewriteExpressionDirect(criteria.getLeftExpression())); criteria.setRightExpression( rewriteExpressionDirect(criteria.getRightExpression()));
void resolveMatchCriteria(MatchCriteria mcrit) throws QueryResolverException { setDesiredType(mcrit.getLeftExpression(), mcrit.getRightExpression().getType(), mcrit); mcrit.setLeftExpression(resolveMatchCriteriaExpression(mcrit, mcrit.getLeftExpression())); setDesiredType(mcrit.getRightExpression(), mcrit.getLeftExpression().getType(), mcrit); mcrit.setRightExpression(resolveMatchCriteriaExpression(mcrit, mcrit.getRightExpression())); }
void resolveMatchCriteria(MatchCriteria mcrit) throws QueryResolverException { setDesiredType(mcrit.getLeftExpression(), mcrit.getRightExpression().getType(), mcrit); mcrit.setLeftExpression(resolveMatchCriteriaExpression(mcrit, mcrit.getLeftExpression())); setDesiredType(mcrit.getRightExpression(), mcrit.getLeftExpression().getType(), mcrit); mcrit.setRightExpression(resolveMatchCriteriaExpression(mcrit, mcrit.getRightExpression())); }
void resolveMatchCriteria(MatchCriteria mcrit) throws QueryResolverException { setDesiredType(mcrit.getLeftExpression(), mcrit.getRightExpression().getType(), mcrit); mcrit.setLeftExpression(resolveMatchCriteriaExpression(mcrit, mcrit.getLeftExpression())); setDesiredType(mcrit.getRightExpression(), mcrit.getLeftExpression().getType(), mcrit); mcrit.setRightExpression(resolveMatchCriteriaExpression(mcrit, mcrit.getRightExpression())); }
@Test public void testMatchCriteria1() { MatchCriteria mc = new MatchCriteria(); mc.setLeftExpression(new ElementSymbol("m.g.e1")); //$NON-NLS-1$ mc.setRightExpression(new Constant("abc")); //$NON-NLS-1$ helpTest(mc, "m.g.e1 LIKE 'abc'"); //$NON-NLS-1$ }
@Test public void testMatchCriteria2() { MatchCriteria mc = new MatchCriteria(); mc.setLeftExpression(new ElementSymbol("m.g.e1")); //$NON-NLS-1$ mc.setRightExpression(new Constant("%")); //$NON-NLS-1$ mc.setEscapeChar('#'); helpTest(mc, "m.g.e1 LIKE '%' ESCAPE '#'"); //$NON-NLS-1$ }
@Test public void testMatchCriteria3() { MatchCriteria mc = new MatchCriteria(); mc.setLeftExpression(new ElementSymbol("m.g.e1")); //$NON-NLS-1$ mc.setRightExpression(new Constant("abc")); //$NON-NLS-1$ mc.setNegated(true); helpTest(mc, "m.g.e1 NOT LIKE 'abc'"); //$NON-NLS-1$ }