本文整理了Java中org.teiid.language.Limit
类的一些代码示例,展示了Limit
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Limit
类的具体详情如下:
包路径:org.teiid.language.Limit
类名称:Limit
[英]Represents a LIMIT clause with row offset and row limit values to bound the resulting rows
[中]表示具有行偏移量和行限制值的LIMIT子句,以绑定结果行
代码示例来源: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) {
return Arrays.asList("FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$
}
代码示例来源:origin: org.teiid.connectors/translator-salesforce
@Override
public void visit(Limit obj) {
if (obj.getRowOffset() > 0) {
bulkEligible = false;
} else {
usePkChunking = false;
super.visit(obj);
}
}
代码示例来源:origin: teiid/teiid
org.teiid.language.Limit translate(Limit limit) {
if (limit == null) {
return null;
}
int rowOffset = 0;
if (limit.getOffset() != null) {
Literal c1 = (Literal)translate(limit.getOffset());
rowOffset = ((Integer)c1.getValue()).intValue();
}
Literal c2 = (Literal)translate(limit.getRowLimit());
int rowLimit = Integer.MAX_VALUE;
if (c2 != null) {
rowLimit = ((Integer)c2.getValue()).intValue();
}
return new org.teiid.language.Limit(rowOffset, rowLimit);
}
代码示例来源: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.jboss.teiid/teiid-engine
org.teiid.language.Limit translate(Limit limit) {
if (limit == null) {
return null;
}
int rowOffset = 0;
if (limit.getOffset() != null) {
Literal c1 = (Literal)translate(limit.getOffset());
rowOffset = ((Integer)c1.getValue()).intValue();
}
Literal c2 = (Literal)translate(limit.getRowLimit());
int rowLimit = Integer.MAX_VALUE;
if (c2 != null) {
rowLimit = ((Integer)c2.getValue()).intValue();
}
return new org.teiid.language.Limit(rowOffset, rowLimit);
}
代码示例来源: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) {
return Arrays.asList("FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$
}
代码示例来源:origin: org.teiid/teiid-engine
org.teiid.language.Limit translate(Limit limit) {
if (limit == null) {
return null;
}
int rowOffset = 0;
if (limit.getOffset() != null) {
Literal c1 = (Literal)translate(limit.getOffset());
rowOffset = ((Integer)c1.getValue()).intValue();
}
Literal c2 = (Literal)translate(limit.getRowLimit());
int rowLimit = Integer.MAX_VALUE;
if (c2 != null) {
rowLimit = ((Integer)c2.getValue()).intValue();
}
return new org.teiid.language.Limit(rowOffset, rowLimit);
}
代码示例来源: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
@Override
public List<?> translateLimit(Limit limit, ExecutionContext context) {
return Arrays.asList("TOP ", limit.getRowLimit()); //$NON-NLS-1$
}
代码示例来源: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: 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-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-ldap
long countLimit = -1;
if(limit != null) {
countLimit = limit.getRowLimit();
代码示例来源: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-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-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: 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()));
}
}
内容来源于网络,如有侵权,请联系作者删除!