Revision 29326 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/IndexFeatureSet.java

View differences:

IndexFeatureSet.java
74 74

  
75 75
		public Object next() {
76 76
			Object oid = it.next();
77
			FeatureReference ref = new DefaultFeatureReference(store, oid);
77
			FeatureReference ref = new DefaultFeatureReference(store
78
					.getFeatureStore(), oid);
78 79
			try {
79
				return store.getFeatureByReference(ref);
80
				return store.getFeatureStore().getFeatureByReference(ref);
80 81
			} catch (DataException e) {
81 82
				throw new ReadRuntimeException(store.getName(), e);
82 83
			}
......
109 110
			Object oid = it.next();
110 111
			try {
111 112
				//				Long longer=new Long(((Integer)oid).longValue());
112
				FeatureReference ref = new DefaultFeatureReference(store, oid);
113
				FeatureReference ref = new DefaultFeatureReference(store
114
						.getFeatureStore(), oid);
113 115
				FeatureProvider data = storeProvider
114 116
						.getFeatureProviderByReference((FeatureReferenceProviderServices) ref);
115 117

  
......
134 136

  
135 137
	public IndexFeatureSet(FeatureIndexProviderServices index, LongList featureReferences) {
136 138
		this.featureReferences = featureReferences;
137
		this.store = index.getFeatureStore();
139
		this.store = index.getFeatureStoreProviderServices();
138 140
		this.storeProvider = store.getProvider();
139 141
		this.index = index;
140 142
	}
......
152 154
	}
153 155

  
154 156
	public DisposableIterator fastIterator(long index) throws DataException {
155
		if (store.isEditing()) {
157
		if (store.getFeatureStore().isEditing()) {
156 158
			return this.iterator(index);
157 159
		}
158 160
		return new FastIndexIterator(this.featureReferences.iterator(index));
159 161
	}
160 162

  
161 163
	public DisposableIterator fastIterator() throws DataException {
162
		if (store.isEditing()) {
164
		if (store.getFeatureStore().isEditing()) {
163 165
			return this.iterator();
164 166
		}
165 167
		return new FastIndexIterator(this.featureReferences.iterator());
......
183 185

  
184 186
	public void delete(Feature feature) throws DataException {
185 187
		index.delete(feature);
186
		store.delete(feature);
188
		store.getFeatureStore().delete(feature);
187 189
	}
188 190

  
189 191
	public FeatureType getDefaultFeatureType() {
......
198 200

  
199 201
	public void insert(EditableFeature feature) throws DataException {
200 202
		index.insert(feature);
201
		store.insert(feature);
203
		store.getFeatureStore().insert(feature);
202 204
	}
203 205

  
204 206
	public void update(EditableFeature feature) throws DataException {
205
		store.update(feature);
207
		store.getFeatureStore().update(feature);
206 208
		// we need to re-index the feature, since its shape might have changed
207 209
		index.delete(feature);
208 210
		index.insert(feature);

Also available in: Unified diff