public static Select getThreadLocalSelect(Select select) { if (select == null) return null; Context[] lctx = JDBCStoreQuery.getThreadLocalContext(); Context cloneFrom = select.ctx(); for (int i = 0; i < lctx.length; i++) { Context cloneTo = getThreadLocalContext(lctx[i], cloneFrom); if (cloneTo != null) return (Select)cloneTo.getSelect(); } return select; }
public static Select getThreadLocalSelect(Select select) { if (select == null) return null; Context[] lctx = JDBCStoreQuery.getThreadLocalContext(); Context cloneFrom = select.ctx(); for (int i = 0; i < lctx.length; i++) { Context cloneTo = getThreadLocalContext(lctx[i], cloneFrom); if (cloneTo != null) return (Select)cloneTo.getSelect(); } return select; }
public static Select getThreadLocalSelect(Select select) { if (select == null) return null; Context[] lctx = JDBCStoreQuery.getThreadLocalContext(); Context cloneFrom = select.ctx(); for (int i = 0; i < lctx.length; i++) { Context cloneTo = getThreadLocalContext(lctx[i], cloneFrom); if (cloneTo != null) return (Select)cloneTo.getSelect(); } return select; }
public static Select getThreadLocalSelect(Select select) { if (select == null) return null; Context[] lctx = JDBCStoreQuery.getThreadLocalContext(); Context cloneFrom = select.ctx(); for (int i = 0; i < lctx.length; i++) { Context cloneTo = getThreadLocalContext(lctx[i], cloneFrom); if (cloneTo != null) return (Select)cloneTo.getSelect(); } return select; }
public SelectImpl clone(Context ctx) { SelectImpl sel = (SelectImpl) _conf.getSQLFactoryInstance().newSelect(); sel._ctx = ctx; if (_parent != null && _parent.ctx() != null) sel._parent = (SelectImpl)_parent.ctx().getSelect(); sel._schemaAlias = _schemaAlias; sel._flags = _flags; return sel; }
public SelectImpl clone(Context ctx) { SelectImpl sel = (SelectImpl) _conf.getSQLFactoryInstance().newSelect(); sel._ctx = ctx; if (_parent != null && _parent.ctx() != null) sel._parent = (SelectImpl)_parent.ctx().getSelect(); sel._schemaAlias = _schemaAlias; sel._flags = _flags; return sel; }
public SelectImpl clone(Context ctx) { SelectImpl sel = (SelectImpl) _conf.getSQLFactoryInstance().newSelect(); sel._ctx = ctx; if (_parent != null && _parent.ctx() != null) sel._parent = (SelectImpl)_parent.ctx().getSelect(); sel._schemaAlias = _schemaAlias; sel._flags = _flags; return sel; }
public SelectImpl clone(Context ctx) { SelectImpl sel = (SelectImpl) _conf.getSQLFactoryInstance().newSelect(); sel._ctx = ctx; if (_parent != null && _parent.ctx() != null) sel._parent = (SelectImpl)_parent.ctx().getSelect(); sel._schemaAlias = _schemaAlias; sel._flags = _flags; return sel; }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }
private static Context clone(Context orig, Context parent) { Context myParent = null; if (parent == null) { Context origParent = orig.getParent(); if (origParent != null) myParent = clone(orig.getParent(), null); } else myParent = parent; Context newCtx = new Context(orig.parsed, null, myParent); newCtx.from = orig.from; newCtx.meta = orig.meta; newCtx.schemaAlias = orig.schemaAlias; newCtx.setSchemas(orig.getSchemas()); newCtx.setVariables(orig.getVariables()); newCtx.cloneFrom = orig; Object select = orig.getSelect(); if (select != null) newCtx.setSelect(((SelectImpl)select).clone(newCtx)); newCtx.subquery = orig.subquery; List<Context> subsels = orig.getSubselContexts(); if (subsels != null) { for (Context subsel : subsels) newCtx.addSubselContext(clone(subsel, newCtx)); } return newCtx; } }
private static Context clone(Context orig, Context parent) { Context myParent = null; if (parent == null) { Context origParent = orig.getParent(); if (origParent != null) myParent = clone(orig.getParent(), null); } else myParent = parent; Context newCtx = new Context(orig.parsed, null, myParent); newCtx.from = orig.from; newCtx.meta = orig.meta; newCtx.schemaAlias = orig.schemaAlias; newCtx.setSchemas(orig.getSchemas()); newCtx.setVariables(orig.getVariables()); newCtx.cloneFrom = orig; Object select = orig.getSelect(); if (select != null) newCtx.setSelect(((SelectImpl)select).clone(newCtx)); newCtx.subquery = orig.subquery; List<Context> subsels = orig.getSubselContexts(); if (subsels != null) { for (Context subsel : subsels) newCtx.addSubselContext(clone(subsel, newCtx)); } return newCtx; } }
private static Context clone(Context orig, Context parent) { Context myParent = null; if (parent == null) { Context origParent = orig.getParent(); if (origParent != null) myParent = clone(orig.getParent(), null); } else myParent = parent; Context newCtx = new Context(orig.parsed, null, myParent); newCtx.from = orig.from; newCtx.meta = orig.meta; newCtx.schemaAlias = orig.schemaAlias; newCtx.setSchemas(orig.getSchemas()); newCtx.setVariables(orig.getVariables()); newCtx.cloneFrom = orig; Object select = orig.getSelect(); if (select != null) newCtx.setSelect(((SelectImpl)select).clone(newCtx)); newCtx.subquery = orig.subquery; List<Context> subsels = orig.getSubselContexts(); if (subsels != null) { for (Context subsel : subsels) newCtx.addSubselContext(clone(subsel, newCtx)); } return newCtx; } }
private static Context clone(Context orig, Context parent) { Context myParent = null; if (parent == null) { Context origParent = orig.getParent(); if (origParent != null) myParent = clone(orig.getParent(), null); } else myParent = parent; Context newCtx = new Context(orig.parsed, null, myParent); newCtx.from = orig.from; newCtx.meta = orig.meta; newCtx.schemaAlias = orig.schemaAlias; newCtx.setSchemas(orig.getSchemas()); newCtx.setVariables(orig.getVariables()); newCtx.cloneFrom = orig; Object select = orig.getSelect(); if (select != null) newCtx.setSelect(((SelectImpl)select).clone(newCtx)); newCtx.subquery = orig.subquery; List<Context> subsels = orig.getSubselContexts(); if (subsels != null) { for (Context subsel : subsels) newCtx.addSubselContext(clone(subsel, newCtx)); } return newCtx; } }
Select subsel = (Select) subselCtx.getSelect(); Subquery subquery = subselCtx.getSubquery(); subsel.setParent(sel, subquery.getCandidateAlias());
Select subsel = (Select) subselCtx.getSelect(); Subquery subquery = subselCtx.getSubquery(); subsel.setParent(sel, subquery.getCandidateAlias());
Select subsel = (Select) subselCtx.getSelect(); Subquery subquery = subselCtx.getSubquery(); subsel.setParent(sel, subquery.getCandidateAlias());
Select subsel = (Select) subselCtx.getSelect(); Subquery subquery = subselCtx.getSubquery(); subsel.setParent(sel, subquery.getCandidateAlias());