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 @ 47779
History | View | Annotate | Download (7.67 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 | 46724 | fdiaz | import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices; |
38 | 44058 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters; |
39 | 45165 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
40 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
41 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation; |
||
42 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CalculateEnvelopeOfColumnOperation; |
||
43 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanCreateTablesOperation; |
||
44 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanModifyTableOperation; |
||
45 | 45473 | fdiaz | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation; |
46 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CreateTableOperation; |
47 | 45473 | fdiaz | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DeletePassThroughOperation; |
48 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DropTableOperation; |
||
49 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ExecuteOperation; |
||
50 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureProviderByReferenceOperation; |
51 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureTypeOperation; |
||
52 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ListTablesOperation; |
||
53 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.PerformChangesOperation; |
||
54 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation; |
||
55 | 46277 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.RetrieveValueOperation; |
56 | 45473 | fdiaz | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.TableIsEmptyOperation; |
57 | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdatePassThroughOperation; |
||
58 | 43020 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdateTableStatisticsOperation; |
59 | import org.gvsig.fmap.geom.primitive.Envelope; |
||
60 | |||
61 | public interface OperationsFactory { |
||
62 | |||
63 | 44058 | jjdelcerro | public interface TableReference { |
64 | public String getDatabase(); |
||
65 | public String getSchema(); |
||
66 | public String getTable(); |
||
67 | public String getSubquery(); |
||
68 | public boolean hasDatabase(); |
||
69 | public boolean hasSchema(); |
||
70 | public boolean hasTable(); |
||
71 | public boolean hasSubquery(); |
||
72 | } |
||
73 | |||
74 | public TableReference createTableReference(
|
||
75 | 43020 | jjdelcerro | String database,
|
76 | String schema,
|
||
77 | String table,
|
||
78 | 44058 | jjdelcerro | String subquery
|
79 | ); |
||
80 | |||
81 | public TableReference createTableReference(JDBCStoreParameters params);
|
||
82 | public TableReference createTableReference(JDBCNewStoreParameters params);
|
||
83 | |||
84 | public FetchFeatureTypeOperation createFetchFeatureType(
|
||
85 | EditableFeatureType type, |
||
86 | TableReference table, |
||
87 | 43020 | jjdelcerro | List<String> primaryKeys, |
88 | String defaultGeometryField,
|
||
89 | IProjection crs |
||
90 | ); |
||
91 | 43377 | jjdelcerro | |
92 | 45626 | fdiaz | public FetchFeatureTypeOperation createFetchFeatureType(
|
93 | EditableFeatureType type, |
||
94 | TableReference table, |
||
95 | List<String> primaryKeys, |
||
96 | String defaultGeometryField,
|
||
97 | IProjection crs, |
||
98 | int geometryType,
|
||
99 | int geometrySubtype
|
||
100 | |||
101 | ); |
||
102 | |||
103 | 43020 | jjdelcerro | public FetchFeatureProviderByReferenceOperation createFetchFeatureProviderByReference(
|
104 | FeatureReferenceProviderServices reference, |
||
105 | FeatureType featureType, |
||
106 | 44058 | jjdelcerro | TableReference table |
107 | 43020 | jjdelcerro | ); |
108 | |||
109 | public CalculateEnvelopeOfColumnOperation createCalculateEnvelopeOfColumn(
|
||
110 | 44376 | jjdelcerro | FeatureType featureType, |
111 | 44058 | jjdelcerro | TableReference table, |
112 | 43020 | jjdelcerro | String columnName,
|
113 | String baseFilter,
|
||
114 | Envelope workingArea, |
||
115 | IProjection crs |
||
116 | ); |
||
117 | |||
118 | public PerformChangesOperation createPerformChanges(
|
||
119 | 44058 | jjdelcerro | TableReference table, |
120 | 43020 | jjdelcerro | FeatureType type, |
121 | Iterator deleteds,
|
||
122 | Iterator inserteds,
|
||
123 | Iterator updateds,
|
||
124 | Iterator featureTypesChanged
|
||
125 | ); |
||
126 | |||
127 | 46724 | fdiaz | public PerformChangesOperation createPerformChanges(
|
128 | TableReference table, |
||
129 | FeatureType type, |
||
130 | Iterator deleteds,
|
||
131 | Iterator inserteds,
|
||
132 | Iterator updateds,
|
||
133 | Iterator featureTypesChanged,
|
||
134 | FeatureStoreProviderServices storeServices |
||
135 | ); |
||
136 | |||
137 | 43020 | jjdelcerro | public AppendOperation createAppend(
|
138 | 44058 | jjdelcerro | TableReference table, |
139 | 43020 | jjdelcerro | FeatureType type |
140 | ); |
||
141 | |||
142 | public CountOperation createCount(
|
||
143 | 44376 | jjdelcerro | FeatureType featureType, |
144 | 44058 | jjdelcerro | TableReference table, |
145 | 43020 | jjdelcerro | String baseFilter,
|
146 | 44727 | jjdelcerro | FeatureQuery query |
147 | 43020 | jjdelcerro | ); |
148 | |||
149 | public TableIsEmptyOperation createTableIsEmpty(
|
||
150 | 44376 | jjdelcerro | FeatureType featureType, |
151 | 44058 | jjdelcerro | TableReference table, |
152 | 43020 | jjdelcerro | String baseFilter,
|
153 | 46010 | jjdelcerro | FeatureQuery query |
154 | 43020 | jjdelcerro | ); |
155 | |||
156 | public ResultSetForSetProviderOperation createResultSetForSetProvider(
|
||
157 | 44058 | jjdelcerro | TableReference table, |
158 | 43020 | jjdelcerro | String baseFilter,
|
159 | String baseOrder,
|
||
160 | FeatureQuery query, |
||
161 | FeatureType storeType, |
||
162 | FeatureType setType, |
||
163 | long limit,
|
||
164 | long offset,
|
||
165 | int fetchSize
|
||
166 | ); |
||
167 | |||
168 | public ListTablesOperation createListTables(
|
||
169 | int mode,
|
||
170 | 45165 | jjdelcerro | JDBCServerExplorerParameters baseParameters, |
171 | 45627 | fdiaz | boolean informationTables,
|
172 | int tablesOrViews
|
||
173 | 43020 | jjdelcerro | ); |
174 | |||
175 | public DropTableOperation createDropTable(
|
||
176 | 44058 | jjdelcerro | TableReference table |
177 | 43020 | jjdelcerro | ); |
178 | |||
179 | public CreateTableOperation createTable(
|
||
180 | 44058 | jjdelcerro | TableReference table, |
181 | 43020 | jjdelcerro | FeatureType type, |
182 | List<Pair<String, SQLBuilder.Privilege>> userAndPrivileges, |
||
183 | List<String> additionalSQLs |
||
184 | ) throws DataException;
|
||
185 | |||
186 | public CanCreateTablesOperation createCanCreateTables();
|
||
187 | |||
188 | public UpdateTableStatisticsOperation createUpdateTableStatistics(
|
||
189 | 44058 | jjdelcerro | TableReference table |
190 | 43020 | jjdelcerro | ); |
191 | |||
192 | public CanModifyTableOperation createCanModifyTableOperation(
|
||
193 | 44058 | jjdelcerro | TableReference table |
194 | 43020 | jjdelcerro | ); |
195 | 43377 | jjdelcerro | |
196 | public ExecuteOperation createExecute(String sql); |
||
197 | |||
198 | 45473 | fdiaz | public UpdatePassThroughOperation createUpdatePassThroughOperation(
|
199 | TableReference table, |
||
200 | Object[] parameters, |
||
201 | Expression filter
|
||
202 | ); |
||
203 | |||
204 | public DeletePassThroughOperation createDeletePassThroughOperation(
|
||
205 | TableReference table, |
||
206 | Expression filter
|
||
207 | ); |
||
208 | |||
209 | 46277 | jjdelcerro | public RetrieveValueOperation createRetrieveValue(
|
210 | TableReference createTableReference, |
||
211 | String filter,
|
||
212 | String order,
|
||
213 | String fieldname
|
||
214 | ); |
||
215 | 45473 | fdiaz | |
216 | 46277 | jjdelcerro | |
217 | 43020 | jjdelcerro | } |