Revision 23680 branches/v2_0_0_prep/libraries/libFMap_dataDB/src/org/gvsig/fmap/data/feature/db/jdbc/postgresql/PostgresqlFeatureCollectionEditing.java

View differences:

PostgresqlFeatureCollectionEditing.java
6 6
import java.util.ConcurrentModificationException;
7 7
import java.util.Iterator;
8 8

  
9
import org.gvsig.tools.exception.BaseException;
10 9
import org.gvsig.fmap.data.DataStore;
11 10
import org.gvsig.fmap.data.ReadException;
12 11
import org.gvsig.fmap.data.feature.FeatureManager;
......
14 13
import org.gvsig.fmap.data.feature.db.DBDataFeatureCollection;
15 14
import org.gvsig.fmap.data.feature.db.DBFeatureType;
16 15
import org.gvsig.fmap.data.feature.db.jdbc.SQLException;
16
import org.gvsig.tools.exception.BaseException;
17 17

  
18 18
public class PostgresqlFeatureCollectionEditing extends DBDataFeatureCollection {
19 19
	protected DBFeatureType featureType;
......
89 89

  
90 90
	}
91 91

  
92

  
93
	public Iterator iterator() {
94
		checkModified();
95
		try{
96
			ResultSet r=null;
97
			r = this.getNewResulset(this.sql);
98
			PostgresIterator dbIter = new PostgresIterator(this.store,
99
					this.featureType, this.sql, this.fetchSize,
100
					this.featureManager);
101
			return dbIter;
102
		} catch (BaseException e){
103
			throw new RuntimeException(e);
104
		}
105
	}
106

  
92
    protected Iterator internalIterator(int index) {
93
        checkModified();
94
        try {
95
            ResultSet r = null;
96
            r = this.getNewResulset(this.sql);
97
            PostgresIterator dbIter = new PostgresIterator(this.store,
98
                    this.featureType, this.sql, this.fetchSize,
99
                    this.featureManager, index + 1);
100
            return dbIter;
101
        } catch (BaseException e) {
102
            throw new RuntimeException(e);
103
        }
104
    }
105
	
107 106
	protected class PostgresIterator extends AbstractPostgresqlDBIterator {
108 107

  
109 108
		public PostgresIterator(PostgresqlStore store,
110 109
				DBFeatureType featureType, String sql, int fetchSize,
111
				FeatureManager featureManager) throws ReadException {
112
			super(store, featureType, sql, fetchSize, featureManager, null);
110
				FeatureManager featureManager, int initialPosition)
111
                throws ReadException {
112
            super(store, featureType, sql, fetchSize, featureManager, null,
113
                    initialPosition);
113 114
		}
114 115

  
115 116
		protected void checkModified() {

Also available in: Unified diff