本文整理了Java中net.sf.jsqlparser.statement.select.Limit.getRowCount()
方法的一些代码示例,展示了Limit.getRowCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Limit.getRowCount()
方法的具体详情如下:
包路径:net.sf.jsqlparser.statement.select.Limit
类名称:Limit
方法名:getRowCount
暂无
代码示例来源:origin: JSQLParser/JSqlParser
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());
}
}
}
}
代码示例来源:origin: alibaba/mdrill
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());
}
}
代码示例来源:origin: JSQLParser/JSqlParser
if (jj_2_48(2)) {
token = jj_consume_token(S_IDENTIFIER);
((JdbcNamedParameter)limit.getRowCount()).setName(token.image);
} else {
代码示例来源:origin: JSQLParser/JSqlParser
if (jj_2_46(2)) {
token = jj_consume_token(S_IDENTIFIER);
((JdbcNamedParameter)limit.getRowCount()).setName(token.image);
} else {
代码示例来源:origin: com.github.jsqlparser/jsqlparser
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());
}
}
}
}
代码示例来源:origin: vincentrussell/sql-to-mongo-db-query-converter
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;
}
代码示例来源:origin: org.opencadc/cadc-adql
/**
* 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);
}
}
代码示例来源:origin: org.opencadc/cadc-jsqlparser-compat
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());
}
}
代码示例来源:origin: diennea/herddb
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);
}
}
代码示例来源:origin: org.opencadc/cadc-adql
public PgLimit(Limit limit)
{
this.offset = limit.getOffset();
this.rowCount = limit.getRowCount();
this.rowCountJdbcParameter = limit.isRowCountJdbcParameter();
this.offsetJdbcParameter = limit.isOffsetJdbcParameter();
this.limitAll = limit.isLimitAll();
}
代码示例来源:origin: com.eas.platypus/platypus-js-sql-parser
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 {
代码示例来源:origin: Quetzal-RDF/quetzal
if (ps.getLimit()!=null && ps.getLimit().getRowCount() == 0 && ps.getLimit().toString().equals("")) {
ret += " LIMIT 0";
代码示例来源:origin: zhicwu/cassandra-jdbc-driver
if (limit.getRowCount() <= 0) {
limit.setRowCount(rowLimit);
代码示例来源:origin: com.github.jsqlparser/jsqlparser
if (jj_2_47(2)) {
token = jj_consume_token(S_IDENTIFIER);
((JdbcNamedParameter)limit.getRowCount()).setName(token.image);
} else {
代码示例来源:origin: com.github.jsqlparser/jsqlparser
if (jj_2_45(2)) {
token = jj_consume_token(S_IDENTIFIER);
((JdbcNamedParameter)limit.getRowCount()).setName(token.image);
} else {
内容来源于网络,如有侵权,请联系作者删除!