private void visitLimitClause(SqlBuilder builder, boolean forSqlValidation) { if (!NO_LIMIT.equals(limit) || !NO_OFFSET.equals(offset)) { builder.sql.append(" LIMIT "); limit.appendQualifiedExpression(builder, forSqlValidation); if (!NO_OFFSET.equals(offset)) { builder.sql.append(" OFFSET "); offset.appendQualifiedExpression(builder, forSqlValidation); } } }
/** * Set the limit of this statement as a SQL expression; e.g. a {@link Function} or the result of * {@link #asFunction()} to use a subquery. Use {@link #NO_LIMIT} for limit to remove the limit. Use * {@link #NO_OFFSET} for offset to remove the offset. * * @param limit the maximum number of rows this query should return * @param offset the number of rows this query should skip * @return this Query object, to allow chaining method calls */ public Query limit(Field<Integer> limit, Field<Integer> offset) { if (limit == null) { limit = NO_LIMIT; } if (offset == null) { offset = NO_OFFSET; } if (immutable) { return fork().limit(limit, offset); } if (!this.limit.equals(limit) || !this.offset.equals(offset)) { this.limit = limit; this.offset = offset; invalidateCompileCache(); } return this; }
/** * Set the limit of this statement as a SQL expression; e.g. a {@link Function} or the result of * {@link #asFunction()} to use a subquery. Use {@link #NO_LIMIT} to remove the limit. * * @param limit the maximum number of rows this query should return * @return this Query object, to allow chaining method calls */ public Query limit(Field<Integer> limit) { if (limit == null) { limit = NO_LIMIT; } if (immutable) { return fork().limit(limit); } if (!this.limit.equals(limit)) { this.limit = limit; invalidateCompileCache(); } return this; }
private void visitLimitClause(SqlBuilder builder, boolean forSqlValidation) { if (!NO_LIMIT.equals(limit) || !NO_OFFSET.equals(offset)) { builder.sql.append(" LIMIT "); limit.appendQualifiedExpression(builder, forSqlValidation); if (!NO_OFFSET.equals(offset)) { builder.sql.append(" OFFSET "); offset.appendQualifiedExpression(builder, forSqlValidation); } } }
/** * Set the limit of this statement as a SQL expression; e.g. a {@link Function} or the result of * {@link #asFunction()} to use a subquery. Use {@link #NO_LIMIT} for limit to remove the limit. Use * {@link #NO_OFFSET} for offset to remove the offset. * * @param limit the maximum number of rows this query should return * @param offset the number of rows this query should skip * @return this Query object, to allow chaining method calls */ public Query limit(Field<Integer> limit, Field<Integer> offset) { if (limit == null) { limit = NO_LIMIT; } if (offset == null) { offset = NO_OFFSET; } if (immutable) { return fork().limit(limit, offset); } if (!this.limit.equals(limit) || !this.offset.equals(offset)) { this.limit = limit; this.offset = offset; invalidateCompileCache(); } return this; }
/** * Set the limit of this statement as a SQL expression; e.g. a {@link Function} or the result of * {@link #asFunction()} to use a subquery. Use {@link #NO_LIMIT} to remove the limit. * * @param limit the maximum number of rows this query should return * @return this Query object, to allow chaining method calls */ public Query limit(Field<Integer> limit) { if (limit == null) { limit = NO_LIMIT; } if (immutable) { return fork().limit(limit); } if (!this.limit.equals(limit)) { this.limit = limit; invalidateCompileCache(); } return this; }