本文整理了Java中org.teiid.language.Limit.getRowLimit()
方法的一些代码示例,展示了Limit.getRowLimit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Limit.getRowLimit()
方法的具体详情如下:
包路径:org.teiid.language.Limit
类名称:Limit
方法名:getRowLimit
[英]Get the max number of rows returned.
[中]获取返回的最大行数。
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@SuppressWarnings("unchecked")
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
return Arrays.asList("FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@SuppressWarnings("unchecked")
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
return Arrays.asList("TOP ", limit.getRowLimit()); //$NON-NLS-1$
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@SuppressWarnings("unchecked")
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
return Arrays.asList("FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
return Arrays.asList("TOP ", limit.getRowLimit()); //$NON-NLS-1$
}
代码示例来源:origin: org.teiid.connectors/translator-mongodb
@Override
public void visit(Limit obj) {
if (obj.getRowLimit() != Integer.MAX_VALUE) {
this.limit = new Integer(obj.getRowLimit());
}
this.skip = new Integer(obj.getRowOffset());
}
代码示例来源:origin: org.teiid.connectors/translator-salesforce
@Override
public void visit(Limit obj) {
super.visit(obj);
limitClause.append(LIMIT).append(SPACE).append(obj.getRowLimit());
}
代码示例来源:origin: org.teiid.connectors/translator-odata
@Override
public void visit(Limit obj) {
if (obj.getRowOffset() != 0) {
this.skip = new Integer(obj.getRowOffset());
}
if (obj.getRowLimit() != 0) {
this.top = new Integer(obj.getRowLimit());
}
}
代码示例来源:origin: teiid/teiid
public void visit(Limit obj) {
buffer.append(LIMIT)
.append(Tokens.SPACE);
if (obj.getRowOffset() > 0) {
buffer.append(obj.getRowOffset())
.append(Tokens.COMMA)
.append(Tokens.SPACE);
}
buffer.append(obj.getRowLimit());
}
代码示例来源:origin: org.teiid.connectors/translator-odata4
@Override
public void visit(Limit obj) {
if (obj.getRowOffset() != 0) {
this.odataQuery.setSkip(new Integer(obj.getRowOffset()));
}
if (obj.getRowLimit() != 0) {
this.odataQuery.setTop(new Integer(obj.getRowLimit()));
}
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
if (limit.getRowOffset() > 0) {
return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset()); //$NON-NLS-1$ //$NON-NLS-2$
}
return null;
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@SuppressWarnings("unchecked")
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
if (limit.getRowOffset() > 0) {
return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset()); //$NON-NLS-1$ //$NON-NLS-2$
}
return null;
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@SuppressWarnings("unchecked")
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
if (limit.getRowOffset() > 0) {
return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset()); //$NON-NLS-1$ //$NON-NLS-2$
}
return null;
}
代码示例来源:origin: org.teiid.connectors/translator-excel
@Override
public void visit(Limit obj) {
int offset = obj.getRowOffset();
if (offset != 0) {
this.firstDataRowNumber = offset + this.firstDataRowNumber;
}
this.filters.add(new CompareFilter(this.firstDataRowNumber, Operator.GE));
this.filters.add(new CompareFilter(this.firstDataRowNumber+obj.getRowLimit(), Operator.LT));
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
if (limit.getRowOffset() > 0) {
return Arrays.asList("OFFSET ", limit.getRowOffset(), " ROWS FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return super.translateLimit(limit, context);
}
代码示例来源:origin: org.teiid.connectors/translator-phoenix
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
if(limit.getRowOffset() > 0) {
return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset()); //$NON-NLS-1$ //$NON-NLS-2$
}
return super.translateLimit(limit, context);
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@SuppressWarnings("unchecked")
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
if (limit.getRowOffset() > 0) {
return Arrays.asList("OFFSET ", limit.getRowOffset(), " FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return super.translateLimit(limit, context);
}
代码示例来源:origin: org.teiid.connectors/translator-jpa
/**
* If the query specifies a Limit, apply that to the query as firstResult
* and maxResults.
*
* @param command the teiid query to be executed
* @param query the JPA query to be executed
*/
private void handleLimit(QueryExpression command, Query query) {
Limit limit = command.getLimit();
if (limit == null) {
return;
}
query.setFirstResult(limit.getRowOffset())
.setMaxResults(limit.getRowLimit());
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
if (getVersion().compareTo(ELEVEN_0) >= 0) {
return Arrays.asList("OFFSET ", limit.getRowOffset(), " ROWS FETCH NEXT ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return super.translateLimit(limit, context);
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
if (limit.getRowOffset() > 0 || limit.getRowLimit() == 0) {
if (limit.getRowLimit() != Integer.MAX_VALUE) {
parts.add(") VIEW_FOR_LIMIT WHERE ROWNUM <= "); //$NON-NLS-1$
parts.add((long)limit.getRowLimit() + limit.getRowOffset());
} else {
parts.add(") VIEW_FOR_LIMIT"); //$NON-NLS-1$
} else {
parts.add(") WHERE ROWNUM <= "); //$NON-NLS-1$
parts.add(limit.getRowLimit());
代码示例来源:origin: org.teiid.connectors/translator-google
public void visit(Select obj) {
buffer.append(SELECT).append(Tokens.SPACE);
if (obj.getFrom() != null && !obj.getFrom().isEmpty()) {
NamedTable table = ((NamedTable)obj.getFrom().get(0));
this.worksheetTitle = table.getName();
if (table.getMetadataObject().getNameInSource() != null) {
this.worksheetTitle = table.getMetadataObject().getNameInSource();
}
}
append(obj.getDerivedColumns());
if (obj.getWhere() != null) {
buffer.append(Tokens.SPACE).append(WHERE).append(Tokens.SPACE);
append(obj.getWhere());
}
if (obj.getGroupBy() != null) {
buffer.append(Tokens.SPACE);
append(obj.getGroupBy());
}
if (obj.getOrderBy() != null) {
buffer.append(Tokens.SPACE);
append(obj.getOrderBy());
}
if (obj.getLimit() != null) {
if (obj.getLimit().getRowOffset() > 0) {
offsetValue = obj.getLimit().getRowOffset();
}
limitValue = obj.getLimit().getRowLimit();
}
}
内容来源于网络,如有侵权,请联系作者删除!