36 |
36 |
import org.gvsig.compat.lang.StringUtils;
|
37 |
37 |
import org.gvsig.fmap.dal.DataTypes;
|
38 |
38 |
import org.gvsig.fmap.dal.cache.AbstractFeatureCacheProvider;
|
39 |
|
import org.gvsig.fmap.dal.exception.CloseException;
|
40 |
39 |
import org.gvsig.fmap.dal.exception.CreateException;
|
41 |
40 |
import org.gvsig.fmap.dal.exception.DataException;
|
42 |
|
import org.gvsig.fmap.dal.exception.OpenException;
|
43 |
41 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
|
44 |
42 |
import org.gvsig.fmap.dal.feature.EditableFeature;
|
45 |
43 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
|
... | ... | |
50 |
48 |
import org.gvsig.fmap.dal.feature.FeatureType;
|
51 |
49 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
|
52 |
50 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeatureReference;
|
53 |
|
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider;
|
54 |
|
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices;
|
55 |
51 |
import org.gvsig.fmap.geom.Geometry;
|
56 |
52 |
|
57 |
53 |
/**
|
58 |
54 |
* @author Vicente Caballero Navarro
|
59 |
55 |
*/
|
60 |
56 |
public class FeatureCacheH2SpatialProvider extends AbstractFeatureCacheProvider {
|
61 |
|
@Override
|
62 |
|
public void clear() {
|
63 |
|
// TODO Auto-generated method stub
|
64 |
|
super.clear();
|
65 |
|
}
|
66 |
|
|
67 |
|
@Override
|
68 |
|
public void close() throws CloseException {
|
69 |
|
// TODO Auto-generated method stub
|
70 |
|
super.close();
|
71 |
|
}
|
72 |
|
|
73 |
|
@Override
|
74 |
|
public void open() throws OpenException {
|
75 |
|
// TODO Auto-generated method stub
|
76 |
|
super.open();
|
77 |
|
}
|
78 |
|
|
79 |
57 |
public static final String NAME = "H2SPATIAL.CACHE";
|
80 |
58 |
public static final String DESCRIPTION = "Cache provider for H2Spatial";
|
81 |
59 |
|
... | ... | |
96 |
74 |
parameters.setDynValue("pkfields", "IDPK");
|
97 |
75 |
|
98 |
76 |
calculateFieldsPosition();
|
99 |
|
// try {
|
100 |
|
// parameters.invokeDynMethod("initialize", null);
|
101 |
|
// } catch (DynMethodException e1) {
|
102 |
|
// e1.printStackTrace();
|
103 |
|
// }
|
|
77 |
|
104 |
78 |
dataServerExplorer.add(parameters, true);
|
105 |
79 |
dataServerExplorer.dispose();
|
106 |
80 |
try {
|
... | ... | |
153 |
127 |
+ "_"
|
154 |
128 |
+ stringUtils.replaceAll(String.valueOf(scale), "\\.", "_")
|
155 |
129 |
.toUpperCase();
|
156 |
|
// return "tablaprueba";
|
157 |
130 |
}
|
158 |
131 |
|
159 |
132 |
@Override
|
... | ... | |
184 |
157 |
}
|
185 |
158 |
}
|
186 |
159 |
}
|
187 |
|
|
188 |
|
public void apply(
|
189 |
|
FeatureStoreProviderServices featureStoreProviderServices,
|
190 |
|
FeatureStoreProvider featureStoreProvider) throws DataException {
|
191 |
|
// EditableFeatureType eft =
|
192 |
|
// featureStoreProviderServices.getDefaultFeatureType().getEditable();
|
193 |
|
// if (featureType.getDefaultGeometryAttribute().getGeometryType() ==
|
194 |
|
// TYPES.GEOMETRY){
|
195 |
|
// throw new NotSupportMultipleGeometriesException();
|
196 |
|
// }
|
197 |
|
|
198 |
|
super.apply(featureStoreProviderServices, featureStoreProvider);
|
199 |
|
}
|
200 |
160 |
}
|