public SQLIntegerExpr clone() { return new SQLIntegerExpr(this.number); }
public SQLDataTypeImpl(String name, int precision, int scale) { this(name); addArgument(new SQLIntegerExpr(precision)); addArgument(new SQLIntegerExpr(scale)); }
public void limit(int rowCount, int offset) { if (offset <= 0) { setFirst(new SQLIntegerExpr(rowCount)); } else { throw new UnsupportedOperationException("not support offset"); } }
public void limit(int rowCount, int offset) { if (offset > 0) { throw new UnsupportedOperationException("not support offset"); } setLimit(new SQLLimit(new SQLIntegerExpr(rowCount))); } }
public void setOffset(int offset) { this.setOffset(new SQLIntegerExpr(offset)); }
public void setTop(int rowCount) { setTop(new SQLServerTop(new SQLIntegerExpr(rowCount))); }
public void setExpr(int expr) { this.setExpr(new SQLIntegerExpr(expr)); }
public void setRowCount(int rowCount) { this.setRowCount(new SQLIntegerExpr(rowCount)); }
public void setPrecision(Integer precision) { this.setPrecision(new SQLIntegerExpr(precision)); }
public SQLDataTypeImpl(String name, int precision) { this(name); addArgument(new SQLIntegerExpr(precision)); }
public static SQLSetStatement plus(SQLName target) { SQLExpr value = new SQLBinaryOpExpr(target.clone(), SQLBinaryOperator.Add, new SQLIntegerExpr(1)); return new SQLSetStatement(target, value); }
public void limit(int rowCount, int offset) { if (offset <= 0) { SQLExpr rowCountExpr = new SQLIntegerExpr(rowCount); SQLExpr newCondition = SQLUtils.buildCondition(SQLBinaryOperator.BooleanAnd, rowCountExpr, false, where); setWhere(newCondition); } else { throw new UnsupportedOperationException("not support offset"); } }
public SQLIntegerExpr integerExpr() { SQLIntegerExpr intExpr = new SQLIntegerExpr(lexer.integerValue()); accept(Token.LITERAL_INT); return intExpr; }
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); }
public static SQLExpr toSQLExpr(Object obj, String dbType) { if (obj == null) { return new SQLNullExpr(); } if (obj instanceof Integer) { return new SQLIntegerExpr((Integer) obj); } if (obj instanceof Number) { return new SQLNumberExpr((Number) obj); } if (obj instanceof String) { return new SQLCharExpr((String) obj); } if (obj instanceof Boolean) { return new SQLBooleanExpr((Boolean) obj); } throw new IllegalArgumentException("not support : " + obj.getClass().getName()); } }
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; }
protected SQLExpr bracketRest(SQLExpr expr) { Number index; if (lexer.token() == Token.LITERAL_INT) { index = lexer.integerValue(); lexer.nextToken(); } else { throw new ParserException("error : " + lexer.stringVal()); } if (expr instanceof SQLMethodInvokeExpr) { SQLMethodInvokeExpr methodInvokeExpr = (SQLMethodInvokeExpr) expr; methodInvokeExpr.getParameters().add(new SQLIntegerExpr(index)); } lexer.nextToken(); expr = primaryRest(expr); return expr; }
temp = new SQLIntegerExpr(lexer.integerValue()); lexer.nextTokenComma(); if (lexer.token != Token.COMMA && lexer.token != Token.EOF && lexer.token != Token.IDENTIFIER) { rowCount = new SQLIntegerExpr(lexer.integerValue()); lexer.nextToken(); if (lexer.token != Token.EOF && lexer.token != Token.IDENTIFIER) {