public void setOffset(SQLExpr offset) { if (limit == null) { limit = new SQLLimit(); } this.limit.setOffset(offset); }
public SQLLimit(SQLExpr offset, SQLExpr rowCount) { this.setOffset(offset); this.setRowCount(rowCount); }
public void setOffset(int offset) { this.setOffset(new SQLIntegerExpr(offset)); }
public SQLLimit clone() { SQLLimit x = new SQLLimit(); if (offset != null) { x.setOffset(offset.clone()); } if (rowCount != null) { x.setRowCount(rowCount.clone()); } return x; }
public void limit(int rowCount, int offset) { SQLLimit limit = new SQLLimit(); limit.setRowCount(new SQLIntegerExpr(rowCount)); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } setLimit(limit); }
private static boolean limitPostgreSQLQueryBlock(PGSelectQueryBlock queryBlock, String dbType, int offset, int count, boolean check) { SQLLimit limit = queryBlock.getLimit(); if (limit != null) { if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } if (check && limit.getRowCount() instanceof SQLNumericLiteralExpr) { int rowCount = ((SQLNumericLiteralExpr) limit.getRowCount()).getNumber().intValue(); if (rowCount <= count && offset <= 0) { return false; } } limit.setRowCount(new SQLIntegerExpr(count)); } limit = new SQLLimit(); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } limit.setRowCount(new SQLIntegerExpr(count)); queryBlock.setLimit(limit); return true; }
private static boolean limitMySqlQueryBlock(SQLSelectQueryBlock queryBlock, String dbType, int offset, int count, boolean check) { SQLLimit limit = queryBlock.getLimit(); if (limit != null) { if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } if (check && limit.getRowCount() instanceof SQLNumericLiteralExpr) { int rowCount = ((SQLNumericLiteralExpr) limit.getRowCount()).getNumber().intValue(); if (rowCount <= count && offset <= 0) { return false; } } else if (check && limit.getRowCount() instanceof SQLVariantRefExpr) { return false; } limit.setRowCount(new SQLIntegerExpr(count)); } if (limit == null) { limit = new SQLLimit(); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } limit.setRowCount(new SQLIntegerExpr(count)); queryBlock.setLimit(limit); } return true; }
private static boolean limitUnion(SQLUnionQuery queryBlock, String dbType, int offset, int count, boolean check) { SQLLimit limit = queryBlock.getLimit(); if (limit != null) { if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } if (check && limit.getRowCount() instanceof SQLNumericLiteralExpr) { int rowCount = ((SQLNumericLiteralExpr) limit.getRowCount()).getNumber().intValue(); if (rowCount <= count && offset <= 0) { return false; } } else if (check && limit.getRowCount() instanceof SQLVariantRefExpr) { return false; } limit.setRowCount(new SQLIntegerExpr(count)); } if (limit == null) { limit = new SQLLimit(); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } limit.setRowCount(new SQLIntegerExpr(count)); queryBlock.setLimit(limit); } return true; }
public void setOffset(SQLExpr offset) { if (limit == null) { limit = new SQLLimit(); } this.limit.setOffset(offset); }
public SQLLimit(SQLExpr offset, SQLExpr rowCount) { this.setOffset(offset); this.setRowCount(rowCount); }
public void setOffset(int offset) { this.setOffset(new SQLIntegerExpr(offset)); }
public SQLLimit clone() { SQLLimit x = new SQLLimit(); if (offset != null) { x.setOffset(offset.clone()); } if (rowCount != null) { x.setRowCount(rowCount.clone()); } return x; }
public void limit(int rowCount, int offset) { SQLLimit limit = new SQLLimit(); limit.setRowCount(new SQLIntegerExpr(rowCount)); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } setLimit(limit); }
private static boolean limitPostgreSQLQueryBlock(PGSelectQueryBlock queryBlock, String dbType, int offset, int count, boolean check) { SQLLimit limit = queryBlock.getLimit(); if (limit != null) { if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } if (check && limit.getRowCount() instanceof SQLNumericLiteralExpr) { int rowCount = ((SQLNumericLiteralExpr) limit.getRowCount()).getNumber().intValue(); if (rowCount <= count && offset <= 0) { return false; } } limit.setRowCount(new SQLIntegerExpr(count)); } limit = new SQLLimit(); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } limit.setRowCount(new SQLIntegerExpr(count)); queryBlock.setLimit(limit); return true; }
limit.setOffset(offset);
private static boolean limitMySqlQueryBlock(SQLSelectQueryBlock queryBlock, String dbType, int offset, int count, boolean check) { SQLLimit limit = queryBlock.getLimit(); if (limit != null) { if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } if (check && limit.getRowCount() instanceof SQLNumericLiteralExpr) { int rowCount = ((SQLNumericLiteralExpr) limit.getRowCount()).getNumber().intValue(); if (rowCount <= count && offset <= 0) { return false; } } else if (check && limit.getRowCount() instanceof SQLVariantRefExpr) { return false; } limit.setRowCount(new SQLIntegerExpr(count)); } if (limit == null) { limit = new SQLLimit(); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } limit.setRowCount(new SQLIntegerExpr(count)); queryBlock.setLimit(limit); } return true; }
private static boolean limitUnion(SQLUnionQuery queryBlock, String dbType, int offset, int count, boolean check) { SQLLimit limit = queryBlock.getLimit(); if (limit != null) { if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } if (check && limit.getRowCount() instanceof SQLNumericLiteralExpr) { int rowCount = ((SQLNumericLiteralExpr) limit.getRowCount()).getNumber().intValue(); if (rowCount <= count && offset <= 0) { return false; } } else if (check && limit.getRowCount() instanceof SQLVariantRefExpr) { return false; } limit.setRowCount(new SQLIntegerExpr(count)); } if (limit == null) { limit = new SQLLimit(); if (offset > 0) { limit.setOffset(new SQLIntegerExpr(offset)); } limit.setRowCount(new SQLIntegerExpr(count)); queryBlock.setLimit(limit); } return true; }
limit.setOffset(offset);