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

View differences:

PostgresqlStore.java
7 7
import java.sql.Statement;
8 8
import java.util.Iterator;
9 9

  
10
import org.gvsig.tools.exception.BaseException;
11 10
import org.gvsig.fmap.data.CloseException;
12 11
import org.gvsig.fmap.data.DataCollection;
12
import org.gvsig.fmap.data.DataException;
13 13
import org.gvsig.fmap.data.DataExplorer;
14 14
import org.gvsig.fmap.data.InitializeException;
15 15
import org.gvsig.fmap.data.OpenException;
......
29 29
import org.gvsig.metadata.IMetadata;
30 30
import org.gvsig.metadata.IMetadataManager;
31 31
import org.gvsig.metadata.MetadataManager;
32
import org.gvsig.tools.exception.BaseException;
32 33
import org.postgis.PGbox2d;
33 34
import org.postgis.PGbox3d;
34 35
import org.postgresql.util.PGobject;
......
82 83
	}
83 84

  
84 85
	public DataCollection getDataCollection(FeatureType type, String filter, String order) throws ReadException {
85
		if (type==null){
86
			type=getDefaultFeatureType();
87
		} else {
88
			if (!type.isSubtypeOf(this.getDefaultFeatureType())){
89
				throw new ReadException("invalid type",this.getName());
90
			}
86
		try {
87
			type = this.checkFeatureTypeForCollection(type);
88
		} catch (DataException e) {
89
			throw new ReadException(this.getName(), e);
91 90
		}
92 91

  
93 92
		if (useSqlSource ){
94
			if (filter != null || order != null || type != getDefaultFeatureType()){
93
			if (filter != null || order != null) {
95 94
				throw new ReadException("Unsuported filter/order in sqlSource mode",this.getName());
96 95
			}
97 96
		}

Also available in: Unified diff