public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { appendTo(sel, ctx, state, sql, index, false); }
/** * Return a path starting from the given subquery. */ public PCPath(SubQ sub) { _candidate = sub.getCandidate(); _actions = new LinkedList(); Action action = new Action(); action.op = Action.SUBQUERY; action.data = sub.getCandidateAlias(); _actions.add(action); _cast = sub.getType(); // initial type is subquery type _varName = sub.getCandidateAlias(); }
public void orderBy(Select sel, ExpContext ctx, ExpState state, boolean asc) { sel.orderBy(newSQLBuffer(sel, ctx, state), asc, false, getSelectAs()); }
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 selectColumns(Select sel, ExpContext ctx, ExpState state, boolean pks) { sel.select(newSQLBuffer(sel, ctx, state), this); }
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks) { selectColumns(sel, ctx, state, pks); }
public Subquery newSubquery(ClassMetaData candidate, boolean subs, String alias) { DBDictionary dict = _type.getMappingRepository().getDBDictionary(); dict.assertSupport(dict.supportsSubselect, "SupportsSubselect"); return new SubQ((ClassMapping) candidate, subs, alias); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { return Filters.convert(res.getObject(this, JavaSQLTypes.JDBC_DEFAULT, null), getType()); }
public void acceptVisit(ExpressionVisitor visitor) { visitor.enter(this); _val.acceptVisit(visitor); _sub.acceptVisit(visitor); visitor.exit(this); } }
public ExpState initialize(Select sel, ExpContext ctx, Map contains) { ExpState subqState = _sub.initialize(sel, ctx, 0); ExpState valueState = _val.initialize(sel, ctx, 0); return new InSubQExpState(valueState.joins, subqState, valueState); }
private String findSubqAlias(Select sel) { Select pSel = sel.getParent(); if (pSel == null) return null; Context pCtx = pSel.ctx(); if (pCtx.subquery == null) return null; if (pCtx.getSchema(_schemaAlias) != null) return ((SubQ)pCtx.subquery).getCandidateAlias(); return findSubqAlias(pSel); }
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 selectColumns(Select sel, ExpContext ctx, ExpState state, boolean pks) { sel.select(newSQLBuffer(sel, ctx, state), this); }
public void select(Select sel, ExpContext ctx, ExpState state, boolean pks) { selectColumns(sel, ctx, state, pks); }
public Subquery newSubquery(ClassMetaData candidate, boolean subs, String alias) { DBDictionary dict = _type.getMappingRepository().getDBDictionary(); dict.assertSupport(dict.supportsSubselect, "SupportsSubselect"); return new SubQ((ClassMapping) candidate, subs, alias); }
public Object load(ExpContext ctx, ExpState state, Result res) throws SQLException { return Filters.convert(res.getObject(this, JavaSQLTypes.JDBC_DEFAULT, null), getType()); }
public void acceptVisit(ExpressionVisitor visitor) { visitor.enter(this); _val.acceptVisit(visitor); _sub.acceptVisit(visitor); visitor.exit(this); } }
public ExpState initialize(Select sel, ExpContext ctx, Map contains) { ExpState subqState = _sub.initialize(sel, ctx, 0); ExpState valueState = _val.initialize(sel, ctx, 0); return new InSubQExpState(valueState.joins, subqState, valueState); }
private String findSubqAlias(Select sel) { Select pSel = sel.getParent(); if (pSel == null) return null; Context pCtx = pSel.ctx(); if (pCtx.subquery == null) return null; if (pCtx.getSchema(_schemaAlias) != null) return ((SubQ)pCtx.subquery).getCandidateAlias(); return findSubqAlias(pSel); }
/** * Return a path starting from the given subquery. */ public PCPath(SubQ sub) { _candidate = sub.getCandidate(); _actions = new LinkedList(); Action action = new Action(); action.op = Action.SUBQUERY; action.data = sub.getCandidateAlias(); _actions.add(action); _cast = sub.getType(); // initial type is subquery type _varName = sub.getCandidateAlias(); }