private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
public void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc) { sel.orderBy(newSQLBuffer(sel, ctx, state), asc, false, getSelectAs()); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { Value[] projs = _exps.projections; for (int i = 0; i < projs.length; i++) { if (projs[i] instanceof GeneralCaseExpression) { ((GeneralCaseExpression)projs[i]).setOtherPath(other); ((GeneralCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof SimpleCaseExpression) { ((SimpleCaseExpression)projs[i]).setOtherPath(other); ((SimpleCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof NullIfExpression) { ((NullIfExpression)projs[i]).setOtherPath(other); ((NullIfExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof CoalesceExpression) { ((CoalesceExpression)projs[i]).setOtherPath(other); ((CoalesceExpression)projs[i]).setOtherState(otherState); } } }
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks){ sel.select(newSQLBuffer(sel, ctx, state), this); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { return Filters.convert(res.getObject(this, JavaSQLTypes.JDBC_DEFAULT, null), getType()); }
public Value nullIfExpression(Value val1, Value val2) { val1 = getLiteralRawString(val1); val2 = getLiteralRawString(val2); return new NullIfExpression((Val) val1, (Val) val2); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { Value[] projs = _exps.projections; for (int i = 0; i < projs.length; i++) { if (projs[i] instanceof GeneralCaseExpression) { ((GeneralCaseExpression)projs[i]).setOtherPath(other); ((GeneralCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof SimpleCaseExpression) { ((SimpleCaseExpression)projs[i]).setOtherPath(other); ((SimpleCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof NullIfExpression) { ((NullIfExpression)projs[i]).setOtherPath(other); ((NullIfExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof CoalesceExpression) { ((CoalesceExpression)projs[i]).setOtherPath(other); ((CoalesceExpression)projs[i]).setOtherState(otherState); } } }
public void groupBy(Select sel, ExpContext ctx, ExpState state) { sel.groupBy(newSQLBuffer(sel, ctx, state)); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { return Filters.convert(res.getObject(this, JavaSQLTypes.JDBC_DEFAULT, null), getType()); }
public Value nullIfExpression(Value val1, Value val2) { val1 = getLiteralRawString(val1); val2 = getLiteralRawString(val2); return new NullIfExpression((Val) val1, (Val) val2); }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
public void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc) { sel.orderBy(newSQLBuffer(sel, ctx, state), asc, false, getSelectAs()); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { Value[] projs = _exps.projections; for (int i = 0; i < projs.length; i++) { if (projs[i] instanceof GeneralCaseExpression) { ((GeneralCaseExpression)projs[i]).setOtherPath(other); ((GeneralCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof SimpleCaseExpression) { ((SimpleCaseExpression)projs[i]).setOtherPath(other); ((SimpleCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof NullIfExpression) { ((NullIfExpression)projs[i]).setOtherPath(other); ((NullIfExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof CoalesceExpression) { ((CoalesceExpression)projs[i]).setOtherPath(other); ((CoalesceExpression)projs[i]).setOtherState(otherState); } } }
public void groupBy(Select sel, ExpContext ctx, ExpState state) { sel.groupBy(newSQLBuffer(sel, ctx, state)); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { return Filters.convert(res.getObject(this, JavaSQLTypes.JDBC_DEFAULT, null), getType()); }
public Value nullIfExpression(Value val1, Value val2) { val1 = getLiteralRawString(val1); val2 = getLiteralRawString(val2); return new NullIfExpression((Val) val1, (Val) val2); }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
public void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc) { sel.orderBy(newSQLBuffer(sel, ctx, state), asc, false, getSelectAs()); }
public void calculateValue(Select sel, ExpContext ctx, ExpState state, Val other, ExpState otherState) { Value[] projs = _exps.projections; for (int i = 0; i < projs.length; i++) { if (projs[i] instanceof GeneralCaseExpression) { ((GeneralCaseExpression)projs[i]).setOtherPath(other); ((GeneralCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof SimpleCaseExpression) { ((SimpleCaseExpression)projs[i]).setOtherPath(other); ((SimpleCaseExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof NullIfExpression) { ((NullIfExpression)projs[i]).setOtherPath(other); ((NullIfExpression)projs[i]).setOtherState(otherState); } else if (projs[i] instanceof CoalesceExpression) { ((CoalesceExpression)projs[i]).setOtherPath(other); ((CoalesceExpression)projs[i]).setOtherState(otherState); } } }
public void groupBy(Select sel, ExpContext ctx, ExpState state) { sel.groupBy(newSQLBuffer(sel, ctx, state)); }