Revision 44505 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java

View differences:

DefaultFeatureType.java
152 152
        this.internalID = internalIDSaved;
153 153
    }
154 154
    
155
    protected void addAll(FeatureType attributes) {
156
        for (FeatureAttributeDescriptor attribute : attributes) {
157
            DefaultFeatureAttributeDescriptor copy = this.getCopyAttributeDescriptor((DefaultFeatureAttributeDescriptor) attribute);
158
            super.add(copy);
159
        }
160
        DefaultFeatureType ft = (DefaultFeatureType) attributes; 
161
        this.pk = null;
162
        this.defaultGeometryAttributeName = ft.defaultGeometryAttributeName;
163
        this.defaultTimeAttributeName = ft.defaultTimeAttributeName;
164
        this.defaultGeometryAttributeIndex = ft.defaultGeometryAttributeIndex;
165
        this.defaultTimeAttributeIndex = ft.defaultTimeAttributeIndex;
166
    }
167
    
155 168
    protected void copyFrom(DefaultFeatureType other, boolean copyAttributes) {
156 169
        this.id = other.getId();
157 170
        if (copyAttributes) {
158
            Iterator iter = other.iterator();
159
            DefaultFeatureAttributeDescriptor attr;
160
            while (iter.hasNext()) {
161
                attr = (DefaultFeatureAttributeDescriptor) iter.next();
162
                DefaultFeatureAttributeDescriptor copy = this.getCopyAttributeDescriptor(attr);
163
                super.add(copy);
164
            }
165
            this.pk = null;
171
            this.addAll((FeatureType)other);
166 172
        }
167
        this.defaultGeometryAttributeName = other.defaultGeometryAttributeName;
168
        this.defaultTimeAttributeName = other.defaultTimeAttributeName;
173

  
169 174
        this.hasEvaluators = other.hasEvaluators;
170 175
        this.hasEmulators = other.hasEmulators;
171 176
        this.rules = (DefaultFeatureRules) other.rules.getCopy();
172
        this.defaultGeometryAttributeIndex = other.defaultGeometryAttributeIndex;
173
        this.defaultTimeAttributeIndex = other.defaultTimeAttributeIndex;
174 177
        this.hasOID = other.hasOID;
175 178
        this.id = other.id; // XXX ???? copiar o no esto????
176 179
        this.internalID = other.internalID;
......
1137 1140
        
1138 1141
        // Si se ha eliminado algun campo -> false
1139 1142
        for (FeatureAttributeDescriptor attr : old) {
1140
            if( this.getAttributeDescriptor(old.getName())==null ) {
1143
            if( this.getAttributeDescriptor(attr.getName())==null ) {
1141 1144
                return false;
1142 1145
            }
1143 1146
        }

Also available in: Unified diff