svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.db / org.gvsig.fmap.dal.db.jdbc / src / main / java / org / gvsig / fmap / dal / store / jdbc2 / OperationsFactory.java @ 46351
History | View | Annotate | Download (7.29 KB)
1 | 45065 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2020 gvSIG Association.
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 3
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program 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
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | */
|
||
24 | 43020 | jjdelcerro | package org.gvsig.fmap.dal.store.jdbc2; |
25 | |||
26 | import java.util.Iterator; |
||
27 | import java.util.List; |
||
28 | import org.apache.commons.lang3.tuple.Pair; |
||
29 | import org.cresques.cts.IProjection; |
||
30 | 45473 | fdiaz | import org.gvsig.expressionevaluator.Expression; |
31 | import org.gvsig.fmap.dal.SQLBuilder; |
||
32 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.exception.DataException; |
33 | import org.gvsig.fmap.dal.feature.EditableFeatureType; |
||
34 | import org.gvsig.fmap.dal.feature.FeatureQuery; |
||
35 | import org.gvsig.fmap.dal.feature.FeatureType; |
||
36 | import org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices; |
||
37 | 44058 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters; |
38 | 45165 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
39 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
40 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation; |
||
41 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CalculateEnvelopeOfColumnOperation; |
||
42 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanCreateTablesOperation; |
||
43 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanModifyTableOperation; |
||
44 | 45473 | fdiaz | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation; |
45 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CreateTableOperation; |
46 | 45473 | fdiaz | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DeletePassThroughOperation; |
47 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DropTableOperation; |
||
48 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ExecuteOperation; |
||
49 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureProviderByReferenceOperation; |
50 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureTypeOperation; |
||
51 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ListTablesOperation; |
||
52 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.PerformChangesOperation; |
||
53 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation; |
||
54 | 46277 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.RetrieveValueOperation; |
55 | 45473 | fdiaz | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.TableIsEmptyOperation; |
56 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdatePassThroughOperation; |
||
57 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdateTableStatisticsOperation; |
58 | import org.gvsig.fmap.geom.primitive.Envelope; |
||
59 | |||
60 | public interface OperationsFactory { |
||
61 | |||
62 | 44058 | jjdelcerro | public interface TableReference { |
63 | public String getDatabase(); |
||
64 | public String getSchema(); |
||
65 | public String getTable(); |
||
66 | public String getSubquery(); |
||
67 | public boolean hasDatabase(); |
||
68 | public boolean hasSchema(); |
||
69 | public boolean hasTable(); |
||
70 | public boolean hasSubquery(); |
||
71 | } |
||
72 | |||
73 | public TableReference createTableReference(
|
||
74 | 43020 | jjdelcerro | String database,
|
75 | String schema,
|
||
76 | String table,
|
||
77 | 44058 | jjdelcerro | String subquery
|
78 | ); |
||
79 | |||
80 | public TableReference createTableReference(JDBCStoreParameters params);
|
||
81 | public TableReference createTableReference(JDBCNewStoreParameters params);
|
||
82 | |||
83 | public FetchFeatureTypeOperation createFetchFeatureType(
|
||
84 | EditableFeatureType type, |
||
85 | TableReference table, |
||
86 | 43020 | jjdelcerro | List<String> primaryKeys, |
87 | String defaultGeometryField,
|
||
88 | IProjection crs |
||
89 | ); |
||
90 | 43377 | jjdelcerro | |
91 | 45626 | fdiaz | public FetchFeatureTypeOperation createFetchFeatureType(
|
92 | EditableFeatureType type, |
||
93 | TableReference table, |
||
94 | List<String> primaryKeys, |
||
95 | String defaultGeometryField,
|
||
96 | IProjection crs, |
||
97 | int geometryType,
|
||
98 | int geometrySubtype
|
||
99 | |||
100 | ); |
||
101 | |||
102 | 43020 | jjdelcerro | public FetchFeatureProviderByReferenceOperation createFetchFeatureProviderByReference(
|
103 | FeatureReferenceProviderServices reference, |
||
104 | FeatureType featureType, |
||
105 | 44058 | jjdelcerro | TableReference table |
106 | 43020 | jjdelcerro | ); |
107 | |||
108 | public CalculateEnvelopeOfColumnOperation createCalculateEnvelopeOfColumn(
|
||
109 | 44376 | jjdelcerro | FeatureType featureType, |
110 | 44058 | jjdelcerro | TableReference table, |
111 | 43020 | jjdelcerro | String columnName,
|
112 | String baseFilter,
|
||
113 | Envelope workingArea, |
||
114 | IProjection crs |
||
115 | ); |
||
116 | |||
117 | public PerformChangesOperation createPerformChanges(
|
||
118 | 44058 | jjdelcerro | TableReference table, |
119 | 43020 | jjdelcerro | FeatureType type, |
120 | Iterator deleteds,
|
||
121 | Iterator inserteds,
|
||
122 | Iterator updateds,
|
||
123 | Iterator featureTypesChanged
|
||
124 | ); |
||
125 | |||
126 | public AppendOperation createAppend(
|
||
127 | 44058 | jjdelcerro | TableReference table, |
128 | 43020 | jjdelcerro | FeatureType type |
129 | ); |
||
130 | |||
131 | public CountOperation createCount(
|
||
132 | 44376 | jjdelcerro | FeatureType featureType, |
133 | 44058 | jjdelcerro | TableReference table, |
134 | 43020 | jjdelcerro | String baseFilter,
|
135 | 44727 | jjdelcerro | FeatureQuery query |
136 | 43020 | jjdelcerro | ); |
137 | |||
138 | public TableIsEmptyOperation createTableIsEmpty(
|
||
139 | 44376 | jjdelcerro | FeatureType featureType, |
140 | 44058 | jjdelcerro | TableReference table, |
141 | 43020 | jjdelcerro | String baseFilter,
|
142 | 46010 | jjdelcerro | FeatureQuery query |
143 | 43020 | jjdelcerro | ); |
144 | |||
145 | public ResultSetForSetProviderOperation createResultSetForSetProvider(
|
||
146 | 44058 | jjdelcerro | TableReference table, |
147 | 43020 | jjdelcerro | String baseFilter,
|
148 | String baseOrder,
|
||
149 | FeatureQuery query, |
||
150 | FeatureType storeType, |
||
151 | FeatureType setType, |
||
152 | long limit,
|
||
153 | long offset,
|
||
154 | int fetchSize
|
||
155 | ); |
||
156 | |||
157 | public ListTablesOperation createListTables(
|
||
158 | int mode,
|
||
159 | 45165 | jjdelcerro | JDBCServerExplorerParameters baseParameters, |
160 | 45627 | fdiaz | boolean informationTables,
|
161 | int tablesOrViews
|
||
162 | 43020 | jjdelcerro | ); |
163 | |||
164 | public DropTableOperation createDropTable(
|
||
165 | 44058 | jjdelcerro | TableReference table |
166 | 43020 | jjdelcerro | ); |
167 | |||
168 | public CreateTableOperation createTable(
|
||
169 | 44058 | jjdelcerro | TableReference table, |
170 | 43020 | jjdelcerro | FeatureType type, |
171 | List<Pair<String, SQLBuilder.Privilege>> userAndPrivileges, |
||
172 | List<String> additionalSQLs |
||
173 | ) throws DataException;
|
||
174 | |||
175 | public CanCreateTablesOperation createCanCreateTables();
|
||
176 | |||
177 | public UpdateTableStatisticsOperation createUpdateTableStatistics(
|
||
178 | 44058 | jjdelcerro | TableReference table |
179 | 43020 | jjdelcerro | ); |
180 | |||
181 | public CanModifyTableOperation createCanModifyTableOperation(
|
||
182 | 44058 | jjdelcerro | TableReference table |
183 | 43020 | jjdelcerro | ); |
184 | 43377 | jjdelcerro | |
185 | public ExecuteOperation createExecute(String sql); |
||
186 | |||
187 | 45473 | fdiaz | public UpdatePassThroughOperation createUpdatePassThroughOperation(
|
188 | TableReference table, |
||
189 | Object[] parameters, |
||
190 | Expression filter
|
||
191 | ); |
||
192 | |||
193 | public DeletePassThroughOperation createDeletePassThroughOperation(
|
||
194 | TableReference table, |
||
195 | Expression filter
|
||
196 | ); |
||
197 | |||
198 | 46277 | jjdelcerro | public RetrieveValueOperation createRetrieveValue(
|
199 | TableReference createTableReference, |
||
200 | String filter,
|
||
201 | String order,
|
||
202 | String fieldname
|
||
203 | ); |
||
204 | 45473 | fdiaz | |
205 | 46277 | jjdelcerro | |
206 | 43020 | jjdelcerro | } |