public void setContext(Context context) { if (_ctx == null) { _ctx = context; _ctx.setSelect(this); } }
public void setContext(Context context) { if (_ctx == null) { _ctx = context; _ctx.setSelect(this); } }
public void setContext(Context context) { if (_ctx == null) { _ctx = context; _ctx.setSelect(this); } }
public void setContext(Context context) { if (_ctx == null) { _ctx = context; _ctx.setSelect(this); } }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { DBDictionary dict = ctx.store.getDBDictionary(); dict.assertSupport(dict.supportsSubselect, "SupportsSubselect"); Select sub = ctx.store.getSQLFactory().newSelect(); sub.setParent(sel, null); // this subselect has the same context as its parent sub.setContext(sel.ctx()); // the context select should still belong to parent sub.ctx().setSelect(sel); ExpState estate = _exp.initialize(sub, ctx, ((NotContainsExpState) state).contains); sub.where(sub.and(null, estate.joins)); SQLBuffer where = new SQLBuffer(dict).append("("); _exp.appendTo(sub, ctx, estate, where); if (where.getSQL().length() > 1) sub.where(where.append(")")); buf.append("0 = "); buf.appendCount(sub, ctx.fetch); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { DBDictionary dict = ctx.store.getDBDictionary(); dict.assertSupport(dict.supportsSubselect, "SupportsSubselect"); Select sub = ctx.store.getSQLFactory().newSelect(); sub.setParent(sel, null); // this subselect has the same context as its parent sub.setContext(sel.ctx()); // the context select should still belong to parent sub.ctx().setSelect(sel); ExpState estate = _exp.initialize(sub, ctx, ((NotContainsExpState) state).contains); sub.where(sub.and(null, estate.joins)); SQLBuffer where = new SQLBuffer(dict).append("("); _exp.appendTo(sub, ctx, estate, where); if (where.getSQL().length() > 1) sub.where(where.append(")")); buf.append("0 = "); buf.appendCount(sub, ctx.fetch); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { DBDictionary dict = ctx.store.getDBDictionary(); dict.assertSupport(dict.supportsSubselect, "SupportsSubselect"); Select sub = ctx.store.getSQLFactory().newSelect(); sub.setParent(sel, null); // this subselect has the same context as its parent sub.setContext(sel.ctx()); // the context select should still belong to parent sub.ctx().setSelect(sel); ExpState estate = _exp.initialize(sub, ctx, ((NotContainsExpState) state).contains); sub.where(sub.and(null, estate.joins)); SQLBuffer where = new SQLBuffer(dict).append("("); _exp.appendTo(sub, ctx, estate, where); if (where.getSQL().length() > 1) sub.where(where.append(")")); buf.append("0 = "); buf.appendCount(sub, ctx.fetch); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer buf) { DBDictionary dict = ctx.store.getDBDictionary(); dict.assertSupport(dict.supportsSubselect, "SupportsSubselect"); Select sub = ctx.store.getSQLFactory().newSelect(); sub.setParent(sel, null); // this subselect has the same context as its parent sub.setContext(sel.ctx()); // the context select should still belong to parent sub.ctx().setSelect(sel); ExpState estate = _exp.initialize(sub, ctx, ((NotContainsExpState) state).contains); sub.where(sub.and(null, estate.joins)); SQLBuffer where = new SQLBuffer(dict).append("("); _exp.appendTo(sub, ctx, estate, where); if (where.getSQL().length() > 1) sub.where(where.append(")")); buf.append("0 = "); buf.appendCount(sub, ctx.fetch); }
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; } }