public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index, String operator) { ArgsExpState astate = (ArgsExpState) state; for (int i = 0; i < _args.length; i++) { _args[i].appendTo(sel, ctx, astate.states[i], sql, index); if( operator != null ) { sql.addCastForParam(operator, _args[i]); } if (i < _args.length-1) sql.append(", "); } }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index, String operator) { ArgsExpState astate = (ArgsExpState) state; for (int i = 0; i < _args.length; i++) { _args[i].appendTo(sel, ctx, astate.states[i], sql, index); if( operator != null ) { sql.addCastForParam(operator, _args[i]); } if (i < _args.length-1) sql.append(", "); } }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index, String operator) { ArgsExpState astate = (ArgsExpState) state; for (int i = 0; i < _args.length; i++) { _args[i].appendTo(sel, ctx, astate.states[i], sql, index); if( operator != null ) { sql.addCastForParam(operator, _args[i]); } if (i < _args.length-1) sql.append(", "); } }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index, String operator) { ArgsExpState astate = (ArgsExpState) state; for (int i = 0; i < _args.length; i++) { _args[i].appendTo(sel, ctx, astate.states[i], sql, index); if( operator != null ) { sql.addCastForParam(operator, _args[i]); } if (i < _args.length-1) sql.append(", "); } }
/** * 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, "*"); } } }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { sql.append(getOperator()); sql.append("("); _val.appendTo(sel, ctx, state, sql, 0); sql.addCastForParam(getOperator(), _val); sql.append(")"); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { sql.append(getOperator()); sql.append(_noParen ? " " : "("); _val.appendTo(sel, ctx, state, sql, 0); // OPENJPA-2149: If _val (Val) is an 'Arg', we need to get the Val[] // from it, and the single element it contains because the // 'addCastForParam' method gets the 'type' from the Val it receives. // In the case where _val is an Arg, when addCastForParam gets the // type, it will be getting the type of the Val (an Object) rather // the type of the Arg. sql.addCastForParam(getOperator(), (_val instanceof Args) ? (((Args) _val).getVals())[0] : _val); if (!_noParen) sql.append(")"); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { sql.append(getOperator()); sql.append(_noParen ? " " : "("); _val.appendTo(sel, ctx, state, sql, 0); // OPENJPA-2149: If _val (Val) is an 'Arg', we need to get the Val[] // from it, and the single element it contains because the // 'addCastForParam' method gets the 'type' from the Val it receives. // In the case where _val is an Arg, when addCastForParam gets the // type, it will be getting the type of the Val (an Object) rather // the type of the Arg. sql.addCastForParam(getOperator(), (_val instanceof Args) ? (((Args) _val).getVals())[0] : _val); if (!_noParen) sql.append(")"); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { sql.append(getOperator()); sql.append(_noParen ? " " : "("); _val.appendTo(sel, ctx, state, sql, 0); // OPENJPA-2149: If _val (Val) is an 'Arg', we need to get the Val[] // from it, and the single element it contains because the // 'addCastForParam' method gets the 'type' from the Val it receives. // In the case where _val is an Arg, when addCastForParam gets the // type, it will be getting the type of the Val (an Object) rather // the type of the Arg. sql.addCastForParam(getOperator(), (_val instanceof Args) ? (((Args) _val).getVals())[0] : _val); if (!_noParen) sql.append(")"); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { sql.append(getOperator()); sql.append(_noParen ? " " : "("); _val.appendTo(sel, ctx, state, sql, 0); // OPENJPA-2149: If _val (Val) is an 'Arg', we need to get the Val[] // from it, and the single element it contains because the // 'addCastForParam' method gets the 'type' from the Val it receives. // In the case where _val is an Arg, when addCastForParam gets the // type, it will be getting the type of the Val (an Object) rather // the type of the Arg. sql.addCastForParam(getOperator(), (_val instanceof Args) ? (((Args) _val).getVals())[0] : _val); if (!_noParen) sql.append(")"); }
@Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { Val val = getValue(); if (val instanceof PCPath) { boolean noParen = getNoParen(); sql.append(getOperator()); sql.append(noParen ? " " : "("); ((PCPath)val).appendTo(sel, ctx, state, sql); sql.addCastForParam(getOperator(), val); if (!noParen) sql.append(")"); } else super.appendTo(sel, ctx, state, sql, index); }
@Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { Val val = getValue(); if (val instanceof PCPath) { boolean noParen = getNoParen(); sql.append(getOperator()); sql.append(noParen ? " " : "("); ((PCPath)val).appendTo(sel, ctx, state, sql); sql.addCastForParam(getOperator(), val); if (!noParen) sql.append(")"); } else super.appendTo(sel, ctx, state, sql, index); }
@Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { Val val = getValue(); if (val instanceof PCPath) { boolean noParen = getNoParen(); sql.append(getOperator()); sql.append(noParen ? " " : "("); ((PCPath)val).appendTo(sel, ctx, state, sql); sql.addCastForParam(getOperator(), val); if (!noParen) sql.append(")"); } else super.appendTo(sel, ctx, state, sql, index); }
@Override public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { Val val = getValue(); if (val instanceof PCPath) { boolean noParen = getNoParen(); sql.append(getOperator()); sql.append(noParen ? " " : "("); ((PCPath)val).appendTo(sel, ctx, state, sql); sql.addCastForParam(getOperator(), val); if (!noParen) sql.append(")"); } else super.appendTo(sel, ctx, state, sql, index); }