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.JDBCFeatureStore;
24: import org.geotools.feature.FeatureType;
25:
26: import com.vividsolutions.jts.geom.Envelope;
27:
28: public class OracleFeatureStore extends JDBCFeatureStore {
29:
30: public OracleFeatureStore(JDBC1DataStore jdbcDataStore,
31: FeatureType featureType) {
32: super (jdbcDataStore, featureType);
33:
34: }
35:
36: public Envelope getBounds() throws IOException {
37: return getBounds(Query.ALL);
38: }
39:
40: /**
41: * Retrieve Bounds of Query results.
42: *
43: * <p>
44: * Currently returns null, consider getFeatures( query ).getBounds()
45: * instead.
46: * </p>
47: *
48: * <p>
49: * Subclasses may override this method to perform the appropriate
50: * optimization for this result.
51: * </p>
52: *
53: * @param query Query we are requesting the bounds of
54: *
55: * @return null representing the lack of an optimization
56: *
57: * @throws IOException DOCUMENT ME!
58: */
59: public Envelope getBounds(Query query) throws IOException {
60: if (query.getTypeName() == null) {
61: query = new DefaultQuery(query);
62: ((DefaultQuery) query).setTypeName(getSchema()
63: .getTypeName());
64: }
65: return ((OracleDataStore) getDataStore()).bounds(query);
66: }
67:
68: }
|