/** * Append parameters only if the given buffer at the given positions. */ public SQLBuffer appendParamOnly(SQLBuffer buf) { append(buf, _sql.length(), (_params == null) ? 0 : _params.size(), true, true); return this; }
public void appendIsNotNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { appendTo(sel, ctx, state, sql, 0); sql.append(" IS NOT ").appendValue(null); }
public void appendTo(SQLBuffer buf, FilterValue target, FilterValue[] args, ClassMapping type, JDBCStore store) { if (!args[0].isConstant()) throw new UserException(_loc.get("const-only", TAG)); Object val = args[0].getValue(); target.appendTo(buf); if (val == null) buf.append(" IS ").appendValue(null); else buf.append(" LIKE ").appendValue("%" + val + "%"); } }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf, int index) { GeneralCaseExpState cstate = (GeneralCaseExpState) state; buf.append(" CASE "); int i = 0; for (; i < _exp.length; i++) _exp[i].appendTo(sel, ctx, cstate.states[i], buf); buf.append(" ELSE "); _val.appendTo(sel, ctx, cstate.states[i], buf, 0); buf.append(" END "); }
public void appendIsEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { PathExpState pstate = (PathExpState) state; if (pstate.field == null) sql.append(FALSE); else pstate.field.appendIsEmpty(sql, sel, pstate.joins); }
public void appendIsNotNull(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { PathExpState pstate = (PathExpState) state; if (pstate.field == null) sql.append(TRUE); else pstate.field.appendIsNotNull(sql, sel, pstate.joins); }
public void appendIsEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { sql.append("NOT EXISTS "); appendTo(sel, ctx, state, sql, 0); }
public void appendIsEmpty(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { PathExpState pstate = (PathExpState) state; if (pstate.field == null) sql.append(FALSE); else pstate.field.appendIsEmpty(sql, sel, pstate.joins); }
public void appendIndex(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { PathExpState pstate = (PathExpState) state; if (pstate.field == null) sql.append("1"); else pstate.field.appendIndex(sql, sel, pstate.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { BinaryOpExpState bstate = (BinaryOpExpState) state; _val1.appendTo(sel, ctx, bstate.state1, buf, 0); buf.append(" THEN "); _val2.appendTo(sel, ctx, bstate.state2, buf, 0); }
public void appendTo(SQLBuffer buf, FilterValue target, FilterValue[] args, ClassMapping type, JDBCStore store) { if (!args[0].isConstant()) throw new UserException(_loc.get("const-only", TAG)); buf.append(args[0].getValue().toString()); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { InSubQExpState istate = (InSubQExpState) state; _sub.calculateValue(sel, ctx, istate.subqState, null, null); _val.calculateValue(sel, ctx, istate.valueState, null, null); _val.appendTo(sel, ctx, istate.valueState, buf, 0); buf.append(" IN "); _sub.appendTo(sel, ctx, istate.valueState, buf, 0); }
public void appendTo(SQLBuffer buf, FilterValue target, FilterValue[] args, ClassMapping type, JDBCStore store) { if (!args[0].isConstant()) throw new UserException(_loc.get("const-only", TAG)); if (!target.isPath()) throw new UserException(_loc.get("path-only", TAG)); // alias the column using the target's context, so that the // correct relation path to the target is used ClassMapping mapping = target.getClassMapping(); String colName = args[0].getValue().toString(); buf.append(target.getColumnAlias(colName, mapping.getTable())); }