/** * Overrides SQL formation by replacing COUNT(column) by COUNT(*) when specific conditions are met and * DBDictionary configuration <code>useWildCardForCount</code> is set. */ @Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { if (isCountDistinctMultiCols()) { getValue().appendTo(sel, ctx, state, sql, 0); sql.addCastForParam(getOperator(), getValue()); } else super.appendTo(sel, ctx, state, sql, index); if ((ctx.store.getDBDictionary().useWildCardForCount && state.joins.isEmpty()) || !isCountDistinct && isCountMultiColumns){ String s = sql.getSQL(); if (s.startsWith("COUNT(") && s.endsWith(")")) { sql.replaceSqlString("COUNT(".length(), s.length()-1, "*"); } } }
/** * Overrides SQL formation by replacing COUNT(column) by COUNT(*) when specific conditions are met and * DBDictionary configuration <code>useWildCardForCount</code> is set. */ @Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { if (isCountDistinctMultiCols()) { getValue().appendTo(sel, ctx, state, sql, 0); sql.addCastForParam(getOperator(), getValue()); } else super.appendTo(sel, ctx, state, sql, index); if ((ctx.store.getDBDictionary().useWildCardForCount && state.joins.isEmpty()) || !isCountDistinct && isCountMultiColumns){ String s = sql.getSQL(); if (s.startsWith("COUNT(") && s.endsWith(")")) { sql.replaceSqlString("COUNT(".length(), s.length()-1, "*"); } } }
/** * Overrides SQL formation by replacing COUNT(column) by COUNT(*) when specific conditions are met and * DBDictionary configuration <code>useWildCardForCount</code> is set. */ @Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { if (isCountDistinctMultiCols()) { getValue().appendTo(sel, ctx, state, sql, 0); sql.addCastForParam(getOperator(), getValue()); } else super.appendTo(sel, ctx, state, sql, index); if ((ctx.store.getDBDictionary().useWildCardForCount && state.joins.isEmpty()) || !isCountDistinct && isCountMultiColumns){ String s = sql.getSQL(); if (s.startsWith("COUNT(") && s.endsWith(")")) { sql.replaceSqlString("COUNT(".length(), s.length()-1, "*"); } } }
/** * Overrides SQL formation by replacing COUNT(column) by COUNT(*) when specific conditions are met and * DBDictionary configuration <code>useWildCardForCount</code> is set. */ @Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { if (isCountDistinctMultiCols()) { getValue().appendTo(sel, ctx, state, sql, 0); sql.addCastForParam(getOperator(), getValue()); } else super.appendTo(sel, ctx, state, sql, index); if ((ctx.store.getDBDictionary().useWildCardForCount && state.joins.isEmpty()) || !isCountDistinct && isCountMultiColumns){ String s = sql.getSQL(); if (s.startsWith("COUNT(") && s.endsWith(")")) { sql.replaceSqlString("COUNT(".length(), s.length()-1, "*"); } } }
Val.JOIN_REL | Val.FORCE_OUTER); if (exps.projections.length > 1 && resultVal instanceof Count) { if (((Count)resultVal).isCountDistinctMultiCols()) throw new UnsupportedException(_loc.get("count-distinct-multi-col-only"));
Val.JOIN_REL | Val.FORCE_OUTER); if (exps.projections.length > 1 && resultVal instanceof Count) { if (((Count)resultVal).isCountDistinctMultiCols()) throw new UnsupportedException(_loc.get("count-distinct-multi-col-only"));
Val.JOIN_REL | Val.FORCE_OUTER); if (exps.projections.length > 1 && resultVal instanceof Count) { if (((Count)resultVal).isCountDistinctMultiCols()) throw new UnsupportedException(_loc.get("count-distinct-multi-col-only"));
Val.JOIN_REL | Val.FORCE_OUTER); if (exps.projections.length > 1 && resultVal instanceof Count) { if (((Count)resultVal).isCountDistinctMultiCols()) throw new UnsupportedException(_loc.get("count-distinct-multi-col-only"));
if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { Select newSel = ctx.store.getSQLFactory().newSelect(); newSel.select("COUNT(*)", val);
if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { Select newSel = ctx.store.getSQLFactory().newSelect(); newSel.select("COUNT(*)", val);
if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { Select newSel = ctx.store.getSQLFactory().newSelect(); newSel.select("COUNT(*)", val);
if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { Select newSel = ctx.store.getSQLFactory().newSelect(); newSel.select("COUNT(*)", val);
if (exps.projections.length == 1) { val = (Val) exps.projections[0]; if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { isCountDistinctMultiCols = true; if (sel.getParent() != null)
if (exps.projections.length == 1) { val = (Val) exps.projections[0]; if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { isCountDistinctMultiCols = true; if (sel.getParent() != null)
if (exps.projections.length == 1) { val = (Val) exps.projections[0]; if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { isCountDistinctMultiCols = true; if (sel.getParent() != null)
if (exps.projections.length == 1) { val = (Val) exps.projections[0]; if (val instanceof Count && ((Count)val).isCountDistinctMultiCols()) { isCountDistinctMultiCols = true; if (sel.getParent() != null)