本文整理了Java中org.geotools.data.Query.getStartIndex
方法的一些代码示例,展示了Query.getStartIndex
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getStartIndex
方法的具体详情如下:
包路径:org.geotools.data.Query
类名称:Query
方法名:getStartIndex
[英]Get the index of the first feature to retrieve.
[中]获取要检索的第一个要素的索引。
代码示例来源:origin: geoserver/geoserver
offset = query.getStartIndex();
maxFeatures =
query.getMaxFeatures() == Integer.MAX_VALUE ? null : query.getMaxFeatures();
if (query.getStartIndex() != null) {
if (!source.getQueryCapabilities().isOffsetSupported()) {
offset = query.getStartIndex();
maxFeatures =
query.getMaxFeatures() == Integer.MAX_VALUE ? null : query.getMaxFeatures();
代码示例来源:origin: geoserver/geoserver
result.setStartIndex(userQuery.getStartIndex());
result.setSortBy(userQuery.getSortBy());
代码示例来源:origin: geotools/geotools
public IndexUniqueVisitorIterator(
FeatureCollection<SimpleFeatureType, SimpleFeature> fc,
Query idQuery,
String idFieldName) {
super();
this.fc = fc;
this.idQuery = idQuery;
this.idFieldName = idFieldName;
this.start = idQuery.getStartIndex() != null ? idQuery.getStartIndex() : 0;
this.max = idQuery.getMaxFeatures();
currentVisitorStart = this.start;
initVisitor();
}
代码示例来源:origin: geotools/geotools
/**
* Applies the limit/offset elements to the query if they are specified and if the dialect
* supports them
*
* @param sql The sql to be modified
* @param the query that holds the limit and offset parameters
*/
public void applyLimitOffset(StringBuffer sql, Query query) {
applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures());
}
代码示例来源:origin: geotools/geotools
if (size >= 0) {
if (query.getStartIndex() != null && txQuery.getStartIndex() == null) {
size -= query.getStartIndex();
代码示例来源:origin: geotools/geotools
StringBuffer sql = new StringBuffer();
boolean offsetLimit = checkLimitOffset(query.getStartIndex(), query.getMaxFeatures());
if (offsetLimit) {
applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures());
代码示例来源:origin: geotools/geotools
/**
* Hashcode based on all parameters other than the handle.
*
* @return hascode for this Query
*/
@Override
public int hashCode() {
String[] n = getPropertyNames();
return ((n == null) ? (-1) : ((n.length == 0) ? 0 : (n.length | n[0].hashCode())))
| getMaxFeatures()
| ((getFilter() == null) ? 0 : getFilter().hashCode())
| ((getTypeName() == null) ? 0 : getTypeName().hashCode())
| ((getVersion() == null) ? 0 : getVersion().hashCode())
| ((getCoordinateSystem() == null) ? 0 : getCoordinateSystem().hashCode())
| ((getCoordinateSystemReproject() == null)
? 0
: getCoordinateSystemReproject().hashCode())
| getStartIndex();
}
代码示例来源:origin: geotools/geotools
applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures());
代码示例来源:origin: geotools/geotools
protected PreparedStatement selectJoinSQLPS(
SimpleFeatureType featureType, JoinInfo join, Query query, Connection cx)
throws SQLException, IOException {
StringBuffer sql = new StringBuffer();
sql.append("SELECT ");
selectColumns(featureType, join.getPrimaryAlias(), query, sql);
// joined columns
for (JoinPart part : join.getParts()) {
selectColumns(part.getQueryFeatureType(), part.getAlias(), query, sql);
}
sql.setLength(sql.length() - 1);
dialect.encodePostSelect(featureType, sql);
sql.append(" FROM ");
// join clauses
encodeTableJoin(featureType, join, query, sql);
// filtering
List<FilterToSQL> toSQLs = encodeWhereJoin(featureType, join, sql);
// sorting
sort(featureType, query.getSortBy(), join.getPrimaryAlias(), sql);
// finally encode limit/offset, if necessary
applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures());
LOGGER.fine(sql.toString());
PreparedStatement ps =
cx.prepareStatement(
sql.toString(), ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
ps.setFetchSize(fetchSize);
setPreparedFilterValues(ps, toSQLs, cx);
return ps;
}
代码示例来源:origin: geotools/geotools
applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures());
代码示例来源:origin: geotools/geotools
protected String selectJoinSQL(SimpleFeatureType featureType, JoinInfo join, Query query)
throws IOException, SQLException {
StringBuffer sql = new StringBuffer();
sql.append("SELECT ");
// column names
selectColumns(featureType, join.getPrimaryAlias(), query, sql);
// joined columns
for (JoinPart part : join.getParts()) {
selectColumns(part.getQueryFeatureType(), part.getAlias(), query, sql);
}
sql.setLength(sql.length() - 1);
dialect.encodePostSelect(featureType, sql);
// from
sql.append(" FROM ");
// join clauses
encodeTableJoin(featureType, join, query, sql);
// filtering
encodeWhereJoin(featureType, join, sql);
// TODO: sorting
sort(featureType, query.getSortBy(), join.getPrimaryAlias(), sql);
// finally encode limit/offset, if necessary
applyLimitOffset(sql, query.getStartIndex(), query.getMaxFeatures());
return sql.toString();
}
代码示例来源:origin: geotools/geotools
if (query.getStartIndex() != null && txQuery.getStartIndex() == null) {
for (int i = 0; i < query.getStartIndex() && transformed.hasNext(); i++) {
transformed.next();
代码示例来源:origin: geotools/geotools
int start = query.getStartIndex() != null ? query.getStartIndex() : 0;
if (sourceFeaturesCounter >= (start + query.getMaxFeatures())) {
return false;
代码示例来源:origin: geotools/geotools
if (query.getStartIndex() != null && query.getStartIndex() > 0) {
if (query.getStartIndex() > count) count = 0;
else count -= query.getStartIndex();
代码示例来源:origin: geotools/geotools
/**
* Copy contructor.
*
* @param query the query to copy
*/
public Query(Query query) {
this(
query.getTypeName(),
query.getNamespace(),
query.getFilter(),
query.getMaxFeatures(),
query.getProperties(),
query.getHandle());
this.sortBy = query.getSortBy();
this.coordinateSystem = query.getCoordinateSystem();
this.coordinateSystemReproject = query.getCoordinateSystemReproject();
this.version = query.getVersion();
this.hints = query.getHints();
this.startIndex = query.getStartIndex();
this.alias = query.getAlias();
this.joins = new ArrayList();
for (Join j : query.getJoins()) {
this.joins.add(new Join(j));
}
}
代码示例来源:origin: geotools/geotools
: getCoordinateSystemReproject()
.equals(other.getCoordinateSystemReproject()))
&& (getStartIndex() == other.getStartIndex())
&& (getHints() == null
? (other.getHints() == null)
代码示例来源:origin: geotools/geotools
|| (query.getStartIndex() != null
&& query.getStartIndex() > 0
&& !canOffset())) {
代码示例来源:origin: geotools/geotools
/**
* Copy contructor, clones the state of a generic Query into a DefaultQuery
*
* @param query
*/
public DefaultQuery(Query query) {
this(
query.getTypeName(),
query.getNamespace(),
query.getFilter(),
query.getMaxFeatures(),
query.getProperties(),
query.getHandle());
this.sortBy = query.getSortBy();
this.coordinateSystem = query.getCoordinateSystem();
this.coordinateSystemReproject = query.getCoordinateSystemReproject();
this.version = query.getVersion();
this.hints = query.getHints();
this.startIndex = query.getStartIndex();
this.alias = query.getAlias();
this.joins = query.getJoins();
}
}
代码示例来源:origin: geotools/geotools
private Query namedQuery(Query query) {
Query namedQuery =
namedQuery(
query.getFilter(), query.getMaxFeatures(), query instanceof JoiningQuery);
namedQuery.setProperties(query.getProperties());
namedQuery.setCoordinateSystem(query.getCoordinateSystem());
namedQuery.setCoordinateSystemReproject(query.getCoordinateSystemReproject());
namedQuery.setHandle(query.getHandle());
namedQuery.setMaxFeatures(query.getMaxFeatures());
namedQuery.setStartIndex(query.getStartIndex());
namedQuery.setSortBy(query.getSortBy());
namedQuery.setHints(query.getHints());
if (query instanceof JoiningQuery) {
((JoiningQuery) namedQuery).setQueryJoins(((JoiningQuery) query).getQueryJoins());
((JoiningQuery) namedQuery).setRootMapping(((JoiningQuery) query).getRootMapping());
}
return namedQuery;
}
代码示例来源:origin: geotools/geotools
if (query.getStartIndex() != null && !caps.isJoiningSupported()) {
txQuery.setStartIndex(null);
内容来源于网络,如有侵权,请联系作者删除!