public void deParse(Limit limit) { buffer.append(" LIMIT "); if (limit.isLimitNull()) { buffer.append("NULL"); } else { if (null != limit.getOffset()) { buffer.append(limit.getOffset()).append(", "); } if (null != limit.getRowCount()) { buffer.append(limit.getRowCount()); } } } }
public void deparseLimit(Limit limit) { // LIMIT n OFFSET skip buffer.append(" LIMIT "); if (limit.isRowCountJdbcParameter()) { buffer.append("?"); } else if (limit.getRowCount() != 0) { buffer.append(limit.getRowCount()); } else { /* from mysql docs: For compatibility with PostgreSQL, MySQL also supports the LIMIT row_count OFFSET offset syntax. To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. */ buffer.append("18446744073709551615"); } if (limit.isOffsetJdbcParameter()) { buffer.append(" OFFSET ?"); } else if (limit.getOffset() != 0) { buffer.append(" OFFSET " + limit.getOffset()); } }
if (jj_2_48(2)) { token = jj_consume_token(S_IDENTIFIER); ((JdbcNamedParameter)limit.getRowCount()).setName(token.image); } else {
if (jj_2_46(2)) { token = jj_consume_token(S_IDENTIFIER); ((JdbcNamedParameter)limit.getRowCount()).setName(token.image); } else {
public void deParse(Limit limit) { buffer.append(" LIMIT "); if (limit.isLimitNull()) { buffer.append("NULL"); } else { if (null != limit.getOffset()) { buffer.append(limit.getOffset()).append(", "); } if (null != limit.getRowCount()) { buffer.append(limit.getRowCount()); } } } }
public static long getLimit(Limit limit) throws ParseException { if (limit!=null) { String rowCountString = SqlUtils.getStringValue(limit.getRowCount()); BigInteger bigInt = new BigInteger(rowCountString); isFalse(bigInt.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) > 0, rowCountString + ": value is too large"); return bigInt.longValue(); } return -1; }
/** * Incorrectly handles limit of 0 by setting the limit to BigInt.MAX when * the limit is 0 so hard code LIMIT 0. * * @param limit */ @Override public void deparseLimit(Limit limit) { log.debug("visit(" + limit.getClass().getSimpleName() + ") " + limit); if (limit.getRowCount() == 0) { buffer.append(" LIMIT 0"); } else { super.deparseLimit(limit); } }
public void deparseLimit(Limit limit) { // LIMIT n OFFSET skip buffer.append(" LIMIT "); if (limit.isRowCountJdbcParameter()) { buffer.append("?"); } else if (limit.getRowCount() != 0) { buffer.append(limit.getRowCount()); } else { /* from mysql docs: For compatibility with PostgreSQL, MySQL also supports the LIMIT row_count OFFSET offset syntax. To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. */ buffer.append("18446744073709551615"); } if (limit.isOffsetJdbcParameter()) { buffer.append(" OFFSET ?"); } else if (limit.getOffset() != 0) { buffer.append(" OFFSET " + limit.getOffset()); } }
private void visitLimit(Limit limit) { if (limit.getOffset() != null) { if (limit.getOffset() instanceof JdbcParameter) { limit.setOffset(ImmutableExpressionsCache.internOrFixJdbcParameterExpression((JdbcParameter) limit.getOffset())); } limit.getOffset().accept(this); } if (limit.getRowCount() != null) { if (limit.getRowCount() instanceof JdbcParameter) { limit.setRowCount(ImmutableExpressionsCache.internOrFixJdbcParameterExpression((JdbcParameter) limit.getRowCount())); } limit.getRowCount().accept(this); } }
public PgLimit(Limit limit) { this.offset = limit.getOffset(); this.rowCount = limit.getRowCount(); this.rowCountJdbcParameter = limit.isRowCountJdbcParameter(); this.offsetJdbcParameter = limit.isOffsetJdbcParameter(); this.limitAll = limit.isLimitAll(); }
if (limit.isRowCountJdbcParameter()) { buffer.append("?"); } else if (limit.getRowCount() != 0) { buffer.append(limit.getRowCount()); buffer.append("?"); } else { if (limit.getRowCount() != 0) { buffer.append(limit.getRowCount()); } else {
if (ps.getLimit()!=null && ps.getLimit().getRowCount() == 0 && ps.getLimit().toString().equals("")) { ret += " LIMIT 0";
if (limit.getRowCount() <= 0) { limit.setRowCount(rowLimit);
if (jj_2_47(2)) { token = jj_consume_token(S_IDENTIFIER); ((JdbcNamedParameter)limit.getRowCount()).setName(token.image); } else {
if (jj_2_45(2)) { token = jj_consume_token(S_IDENTIFIER); ((JdbcNamedParameter)limit.getRowCount()).setName(token.image); } else {