Revision 25785 branches/v2_0_0_prep/libraries/libFMap_dal/src-test/org/gvsig/fmap/dal/feature/impl/JoinTransform.java
JoinTransform.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.dal.feature.impl; |
2 | 2 |
|
3 |
import java.util.Arrays; |
|
3 | 4 |
import java.util.HashMap; |
4 | 5 |
import java.util.Iterator; |
5 | 6 |
import java.util.Map; |
... | ... | |
14 | 15 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
15 | 16 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
16 | 17 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
18 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
17 | 19 |
import org.gvsig.tools.evaluator.Evaluator; |
18 | 20 |
import org.gvsig.tools.persistence.PersistenceException; |
19 | 21 |
import org.gvsig.tools.persistence.PersistentState; |
... | ... | |
102 | 104 |
// default feature type, |
103 | 105 |
// calculate an alternate name and add it to our type |
104 | 106 |
int j = 0; |
105 |
while (type.get(name) != null) {
|
|
107 |
while (type.getIndex(name) >= 0) {
|
|
106 | 108 |
name = attrs[i] + "_" + ++j; |
107 | 109 |
} |
108 | 110 |
type.add(name, store2.getDefaultFeatureType() |
... | ... | |
113 | 115 |
} |
114 | 116 |
|
115 | 117 |
// assign calculated feature type as this transform's feature type |
116 |
setDefaultFeatureType(type.getNotEditableCopy()); |
|
118 |
FeatureType[] types = new FeatureType[] { type.getNotEditableCopy() }; |
|
119 |
setFeatureTypes(Arrays.asList(types), types[0]); |
|
117 | 120 |
} |
118 | 121 |
|
119 | 122 |
/** |
Also available in: Unified diff