@Test public void testFetch() throws IOException { ArcSDEQuery queryAll = getQueryAll(); try { queryAll.fetch(); fail("fetch without calling execute"); } catch (IllegalStateException e) { } queryAll.execute(); assertNotNull(queryAll.fetch()); queryAll.close(); try { queryAll.fetch(); fail("fetch after close!"); } catch (IllegalStateException e) { } queryAll.session.dispose(); }
public SdeRow fetch() throws IOException, IllegalStateException { if (this.query == null) { throw new IllegalStateException("query closed or not yet executed"); } final SeQuery seQuery = getSeQuery(); try { currentRow = session.fetch(seQuery); } catch (IOException e) { close(); String msg = "Error fetching row for " + this.schema.getTypeName() + "["; msg += "\nFilter: " + filters.sourceFilter; msg += "\n where clause sent: " + filters.sdeSqlConstruct.getWhere(); msg += "\ngeometry filter:" + filters.geometryFilter; LOGGER.log(Level.WARNING, msg, e); throw e; } catch (Exception e) { close(); LOGGER.log(Level.SEVERE, "fetching row: " + e.getMessage(), e); throw new DataSourceException("fetching row: " + e.getMessage(), e); } if (currentRow != null) { currentRow.setPreviousValues(this.previousRowValues); previousRowValues = currentRow.getAll(); } return currentRow; }
ArcSDEQuery { public SdeRow fetch() throws IOException, IllegalStateException { if (this.query == null) { throw new IllegalStateException("query closed or not yet executed"); } final SeQuery seQuery = getSeQuery(); try { currentRow = session.fetch(seQuery); } catch (IOException e) { close(); String msg = "Error fetching row for " + this.schema.getTypeName() + "["; msg += "\nFilter: " + filters.sourceFilter; msg += "\n where clause sent: " + filters.sdeSqlConstruct.getWhere(); msg += "\ngeometry filter:" + filters.geometryFilter; LOGGER.log(Level.WARNING, msg, e); throw e; } catch (Exception e) { close(); LOGGER.log(Level.SEVERE, "fetching row: " + e.getMessage(), e); throw new DataSourceException("fetching row: " + e.getMessage(), e); } if (currentRow != null) { currentRow.setPreviousValues(this.previousRowValues); previousRowValues = currentRow.getAll(); } return currentRow; } }
ArcSDEQuery { public SdeRow fetch() throws IOException, IllegalStateException { if (this.query == null) { throw new IllegalStateException("query closed or not yet executed"); } final SeQuery seQuery = getSeQuery(); try { currentRow = session.fetch(seQuery); } catch (IOException e) { close(); String msg = "Error fetching row for " + this.schema.getTypeName() + "["; msg += "\nFilter: " + filters.sourceFilter; msg += "\n where clause sent: " + filters.sdeSqlConstruct.getWhere(); msg += "\ngeometry filter:" + filters.geometryFilter; LOGGER.log(Level.WARNING, msg, e); throw e; } catch (Exception e) { close(); LOGGER.log(Level.SEVERE, "fetching row: " + e.getMessage(), e); throw new DataSourceException("fetching row: " + e.getMessage(), e); } if (currentRow != null) { currentRow.setPreviousValues(this.previousRowValues); previousRowValues = currentRow.getAll(); } return currentRow; } private  ArcSDEQuery(final ISession session, final SimpleFeatureType schema,
            final FilterSet filterSet, final String sortByClause, final FIDReader fidReader,
            ArcSdeVersionHandler versioningHandler); }
ArcSDEQuery { public SdeRow fetch() throws IOException, IllegalStateException { if (this.query == null) { throw new IllegalStateException("query closed or not yet executed"); } final SeQuery seQuery = getSeQuery(); try { currentRow = session.fetch(seQuery); } catch (IOException e) { close(); String msg = "Error fetching row for " + this.schema.getTypeName() + "["; msg += "\nFilter: " + filters.sourceFilter; msg += "\n where clause sent: " + filters.sdeSqlConstruct.getWhere(); msg += "\ngeometry filter:" + filters.geometryFilter; LOGGER.log(Level.WARNING, msg, e); throw e; } catch (Exception e) { close(); LOGGER.log(Level.SEVERE, "fetching row: " + e.getMessage(), e); throw new DataSourceException("fetching row: " + e.getMessage(), e); } if (currentRow != null) { currentRow.setPreviousValues(this.previousRowValues); previousRowValues = currentRow.getAll(); } return currentRow; } private  ArcSDEQuery(final ISession session, final SimpleFeatureType schema,
            final FilterSet filterSet, final String sortByClause, final FIDReader fidReader,
            ArcSdeVersionHandler versioningHandler); static ArcSDEQuery createQuery(final ISession session,
            final SimpleFeatureType fullSchema, final Query query, final FIDReader fidReader,
            final ArcSdeVersionHandler versioningHandler); static ArcSDEQuery createInprocessViewQuery(final ISession session,
            final SimpleFeatureType fullSchema, final Query query,
            final SeQueryInfo definitionQuery, final PlainSelect viewSelectStatement); static SimpleFeatureType getQuerySchema(final String[] queryProperties,
            Filter unsupportedFilter, final SimpleFeatureType fullSchema); FIDReader getFidReader(); SimpleFeatureType getSchema(); ArcSDEQuery.FilterSet getFilters(); static int calculateResultCount(final ISession session, final FeatureTypeInfo typeInfo,
            final Query query, final ArcSdeVersionHandler versioningHandler); static Envelope calculateQueryExtent(final ISession session,
            final FeatureTypeInfo typeInfo, final Query query,
            final ArcSdeVersionHandler versioningHandler); int calculateResultCount(); Envelope calculateQueryExtent(); void close(); void execute(); SdeRow fetch(); void setSpatialConstraints(SeFilter[] filters); @Override String toString(); }
ArcSDEQuery { public SdeRow fetch() throws IOException, IllegalStateException { if (this.query == null) { throw new IllegalStateException("query closed or not yet executed"); } final SeQuery seQuery = getSeQuery(); try { currentRow = session.fetch(seQuery); } catch (IOException e) { close(); String msg = "Error fetching row for " + this.schema.getTypeName() + "["; msg += "\nFilter: " + filters.sourceFilter; msg += "\n where clause sent: " + filters.sdeSqlConstruct.getWhere(); msg += "\ngeometry filter:" + filters.geometryFilter; LOGGER.log(Level.WARNING, msg, e); throw e; } catch (Exception e) { close(); LOGGER.log(Level.SEVERE, "fetching row: " + e.getMessage(), e); throw new DataSourceException("fetching row: " + e.getMessage(), e); } if (currentRow != null) { currentRow.setPreviousValues(this.previousRowValues); previousRowValues = currentRow.getAll(); } return currentRow; } private  ArcSDEQuery(final ISession session, final SimpleFeatureType schema,
            final FilterSet filterSet, final String sortByClause, final FIDReader fidReader,
            ArcSdeVersionHandler versioningHandler); static ArcSDEQuery createQuery(final ISession session,
            final SimpleFeatureType fullSchema, final Query query, final FIDReader fidReader,
            final ArcSdeVersionHandler versioningHandler); static ArcSDEQuery createInprocessViewQuery(final ISession session,
            final SimpleFeatureType fullSchema, final Query query,
            final SeQueryInfo definitionQuery, final PlainSelect viewSelectStatement); static SimpleFeatureType getQuerySchema(final String[] queryProperties,
            Filter unsupportedFilter, final SimpleFeatureType fullSchema); FIDReader getFidReader(); SimpleFeatureType getSchema(); ArcSDEQuery.FilterSet getFilters(); static int calculateResultCount(final ISession session, final FeatureTypeInfo typeInfo,
            final Query query, final ArcSdeVersionHandler versioningHandler); static Envelope calculateQueryExtent(final ISession session,
            final FeatureTypeInfo typeInfo, final Query query,
            final ArcSdeVersionHandler versioningHandler); int calculateResultCount(); Envelope calculateQueryExtent(); void close(); void execute(); SdeRow fetch(); void setSpatialConstraints(SeFilter[] filters); @Override String toString();  }