Revision 12040 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableDBAdapter.java

View differences:

VectorialEditableDBAdapter.java
30 30
 */
31 31
public class VectorialEditableDBAdapter extends VectorialEditableAdapter
32 32
		implements ISpatialDB {
33

  
33
	private int maxIndex=0;
34 34
	private class MyIterator implements IFeatureIterator {
35 35
		private Rectangle2D extent = null;
36 36

  
......
72 72
				if (bOriginalCursorOpened) {
73 73
					feat = featIt.next();
74 74
					int originalIndex = dbDriver.getRowIndexByFID(feat);
75

  
76 75
					// Iteramos hasta que encontremos alguno no borrado.
77 76
					// Aqu? suponemos que el orden es el original. Si no, no funcionar?.
78 77
					if (delRows.get(originalIndex)) // Si est? borrado
......
294 293
				 IFeature feat = ova.getFeature(i);
295 294
				 Integer calculatedIndex = new Integer(i);
296 295
				 mapFID2index.put(feat.getID(), calculatedIndex);
296
				 int featInt=Integer.parseInt(feat.getID());
297
				 if (maxIndex<featInt){
298
					 maxIndex=featInt;
299
				 }
297 300
				 mapIndex2FID.put(calculatedIndex, feat.getID());
298 301
			 }
299 302

  
......
415 418
		mapIndex2FID.clear();
416 419
	}
417 420

  
421
	public int getNewIndex() throws com.hardcode.gdbms.engine.data.driver.DriverException {
422
		int index = maxIndex+1;
423
		while(mapFID2index.containsKey(String.valueOf(index))){
424
			index++;
425
		}
426
		return index;
427
	}
418 428

  
429

  
419 430
}

Also available in: Unified diff