public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { BinaryOpExpState bstate = (BinaryOpExpState) state; _val1.calculateValue(sel, ctx, bstate.state1, _val2, bstate.state2); _val2.calculateValue(sel, ctx, bstate.state2, _val1, bstate.state1); Class val1Type = _val1.getType(); Class val2Type = _val2.getType(); // For purposes of the 'canConvert', when dealing with a Lit with Raw // use a String type since Raw contains a String. if (_val1 instanceof Lit && val1Type.isAssignableFrom(Raw.class)){ val1Type = String.class; } if (_val2 instanceof Lit && val2Type.isAssignableFrom(Raw.class)){ val2Type = String.class; } if (!Filters.canConvert(val1Type, val2Type, false) && !Filters.canConvert(val2Type, val1Type, false)) throw new UserException(_loc.get("cant-convert", val1Type, val2Type)); ctx.store.getDBDictionary().comparison(buf, _op, new FilterValueImpl(sel, ctx, bstate.state1, _val1), new FilterValueImpl(sel, ctx, bstate.state2, _val2)); if (sel != null) sel.append(buf, state.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { BinaryOpExpState bstate = (BinaryOpExpState) state; _val1.calculateValue(sel, ctx, bstate.state1, _val2, bstate.state2); _val2.calculateValue(sel, ctx, bstate.state2, _val1, bstate.state1); Class val1Type = _val1.getType(); Class val2Type = _val2.getType(); // For purposes of the 'canConvert', when dealing with a Lit with Raw // use a String type since Raw contains a String. if (_val1 instanceof Lit && val1Type.isAssignableFrom(Raw.class)){ val1Type = String.class; } if (_val2 instanceof Lit && val2Type.isAssignableFrom(Raw.class)){ val2Type = String.class; } if (!Filters.canConvert(val1Type, val2Type, false) && !Filters.canConvert(val2Type, val1Type, false)) throw new UserException(_loc.get("cant-convert", val1Type, val2Type)); ctx.store.getDBDictionary().comparison(buf, _op, new FilterValueImpl(sel, ctx, bstate.state1, _val1), new FilterValueImpl(sel, ctx, bstate.state2, _val2)); if (sel != null) sel.append(buf, state.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { BinaryOpExpState bstate = (BinaryOpExpState) state; _val1.calculateValue(sel, ctx, bstate.state1, _val2, bstate.state2); _val2.calculateValue(sel, ctx, bstate.state2, _val1, bstate.state1); Class val1Type = _val1.getType(); Class val2Type = _val2.getType(); // For purposes of the 'canConvert', when dealing with a Lit with Raw // use a String type since Raw contains a String. if (_val1 instanceof Lit && val1Type.isAssignableFrom(Raw.class)){ val1Type = String.class; } if (_val2 instanceof Lit && val2Type.isAssignableFrom(Raw.class)){ val2Type = String.class; } if (!Filters.canConvert(val1Type, val2Type, false) && !Filters.canConvert(val2Type, val1Type, false)) throw new UserException(_loc.get("cant-convert", val1Type, val2Type)); ctx.store.getDBDictionary().comparison(buf, _op, new FilterValueImpl(sel, ctx, bstate.state1, _val1), new FilterValueImpl(sel, ctx, bstate.state2, _val2)); if (sel != null) sel.append(buf, state.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { BinaryOpExpState bstate = (BinaryOpExpState) state; _val1.calculateValue(sel, ctx, bstate.state1, _val2, bstate.state2); _val2.calculateValue(sel, ctx, bstate.state2, _val1, bstate.state1); Class val1Type = _val1.getType(); Class val2Type = _val2.getType(); // For purposes of the 'canConvert', when dealing with a Lit with Raw // use a String type since Raw contains a String. if (_val1 instanceof Lit && val1Type.isAssignableFrom(Raw.class)){ val1Type = String.class; } if (_val2 instanceof Lit && val2Type.isAssignableFrom(Raw.class)){ val2Type = String.class; } if (!Filters.canConvert(val1Type, val2Type, false) && !Filters.canConvert(val2Type, val1Type, false)) throw new UserException(_loc.get("cant-convert", val1Type, val2Type)); ctx.store.getDBDictionary().comparison(buf, _op, new FilterValueImpl(sel, ctx, bstate.state1, _val1), new FilterValueImpl(sel, ctx, bstate.state2, _val2)); if (sel != null) sel.append(buf, state.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { BinaryOpExpState bstate = (BinaryOpExpState) state; _val1.calculateValue(sel, ctx, bstate.state1, _val2, bstate.state2); _val2.calculateValue(sel, ctx, bstate.state2, _val1, bstate.state1); if (!Filters.canConvert(_val1.getType(), _val2.getType(), false) && !Filters.canConvert(_val2.getType(), _val1.getType(), false)) throw new UserException(_loc.get("cant-convert", _val1.getType(), _val2.getType())); ctx.store.getDBDictionary().comparison(buf, _op, new FilterValueImpl(sel, ctx, bstate.state1, _val1), new FilterValueImpl(sel, ctx, bstate.state2, _val2)); sel.append(buf, state.joins); }
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "=", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "=", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "<>", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "=", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "<>", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "<>", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "<>", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
if (val1.length(sel, ctx, bstate.state1) == 1 && val2.length(sel, ctx, bstate.state2) == 1) { ctx.store.getDBDictionary().comparison(buf, "<>", new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
op = "<>"; ctx.store.getDBDictionary().comparison(buf, op, new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
op = "<>"; ctx.store.getDBDictionary().comparison(buf, op, new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
op = "<>"; ctx.store.getDBDictionary().comparison(buf, op, new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
op = "<>"; ctx.store.getDBDictionary().comparison(buf, op, new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
op = "<>"; ctx.store.getDBDictionary().comparison(buf, op, new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
op = "<>"; ctx.store.getDBDictionary().comparison(buf, op, new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));
op = "<>"; ctx.store.getDBDictionary().comparison(buf, op, new FilterValueImpl(sel, ctx, bstate.state1, val1), new FilterValueImpl(sel, ctx, bstate.state2, val2));