01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data.oracle;
17:
18: import java.io.IOException;
19:
20: import org.geotools.data.DefaultQuery;
21: import org.geotools.data.Query;
22: import org.geotools.data.jdbc.JDBC1DataStore;
23: import org.geotools.data.jdbc.JDBCFeatureSource;
24: import org.geotools.feature.FeatureType;
25:
26: import com.vividsolutions.jts.geom.Envelope;
27:
28: public class OracleFeatureSource extends JDBCFeatureSource {
29:
30: OracleFeatureSource(JDBC1DataStore jdbcDataStore,
31: FeatureType featureType) {
32: super (jdbcDataStore, featureType);
33: }
34:
35: public Envelope getBounds() throws IOException {
36: return getBounds(Query.ALL);
37: }
38:
39: /**
40: * Retrieve Bounds of Query results.
41: *
42: * <p>
43: * Currently returns null, consider getFeatures( query ).getBounds()
44: * instead.
45: * </p>
46: *
47: * <p>
48: * Subclasses may override this method to perform the appropriate
49: * optimization for this result.
50: * </p>
51: *
52: * @param query Query we are requesting the bounds of
53: *
54: * @return null representing the lack of an optimization
55: *
56: * @throws IOException DOCUMENT ME!
57: */
58: public Envelope getBounds(Query query) throws IOException {
59: if (query.getTypeName() == null) {
60: query = new DefaultQuery(query);
61: ((DefaultQuery) query).setTypeName(getSchema()
62: .getTypeName());
63: }
64: return ((OracleDataStore) getDataStore()).bounds(query);
65: }
66:
67: }
|