本文整理了Java中org.datanucleus.store.query.Query.setRange
方法的一些代码示例,展示了Query.setRange
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setRange
方法的具体详情如下:
包路径:org.datanucleus.store.query.Query
类名称:Query
方法名:setRange
暂无
代码示例来源:origin: org.datanucleus/datanucleus-jpa
/**
* Method to set the results to start from a particular position.
* @param startPosition position of first result numbered from 0
* @return The query
*/
public JPAQuery<X> setFirstResult(int startPosition)
{
if (startPosition < 0)
{
throw new IllegalArgumentException(LOCALISER.msg("Query.StartPositionInvalid"));
}
this.startPosition = startPosition;
if (this.maxResults == Long.MAX_VALUE)
{
query.setRange(this.startPosition, Long.MAX_VALUE);
}
else
{
query.setRange(this.startPosition, this.startPosition+this.maxResults);
}
return this;
}
代码示例来源:origin: org.datanucleus/datanucleus-jpa
/**
* Method to set the max number of results to return.
* @param max Number of results max
* @return The query
*/
public JPAQuery<X> setMaxResults(int max)
{
if (max < 0)
{
throw new IllegalArgumentException(LOCALISER.msg("Query.MaxResultsInvalid"));
}
this.maxResults = max;
query.setRange(startPosition, startPosition+max);
return this;
}
代码示例来源:origin: org.datanucleus/datanucleus-java5
/**
* Method to set the max number of results to return.
* @param max Number of results max
* @return The query
*/
public Query setMaxResults(int max)
{
if (max < 0)
{
throw new IllegalArgumentException(LOCALISER.msg("Query.MaxResultsInvalid"));
}
this.maxResults = max;
query.setRange(startPosition, startPosition+max);
return this;
}
代码示例来源:origin: org.datanucleus/datanucleus-java5
/**
* Method to set the results to start from a particular position.
* @param startPosition position of first result numbered from 0
* @return The query
*/
public Query setFirstResult(int startPosition)
{
if (startPosition < 0)
{
throw new IllegalArgumentException(LOCALISER.msg("Query.StartPositionInvalid"));
}
this.startPosition = startPosition;
query.setRange(this.startPosition, this.maxResults);
return this;
}
代码示例来源:origin: org.datanucleus/datanucleus-api-jdo
/**
* Set the range for the query.
* @param range The range specification
*/
public void setRange(String range)
{
assertIsOpen();
try
{
query.setRange(range);
}
catch (NucleusException jpe)
{
throw NucleusJDOHelper.getJDOExceptionForNucleusException(jpe);
}
}
代码示例来源:origin: org.datanucleus/datanucleus-api-jdo
/**
* Set the range for the query.
* @param fromIncl From range inclusive
* @param toExcl To range exclusive
*/
public void setRange(long fromIncl, long toExcl)
{
assertIsOpen();
try
{
query.setRange(fromIncl, toExcl);
}
catch (NucleusException jpe)
{
throw NucleusJDOHelper.getJDOExceptionForNucleusException(jpe);
}
}
内容来源于网络,如有侵权,请联系作者删除!