Revision 44376 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
DefaultFeatureType.java | ||
---|---|---|
392 | 392 |
|
393 | 393 |
if (ArrayUtils.isEmpty(names)) { |
394 | 394 |
for (FeatureAttributeDescriptor attrdesc : parent) { |
395 |
attrnames.add(attrdesc.getName()); |
|
395 |
attrnames.add(attrdesc.getName().toLowerCase());
|
|
396 | 396 |
} |
397 |
} else { |
|
397 |
} else {
|
|
398 | 398 |
attrnames.addAll(Arrays.asList(names)); |
399 | 399 |
requiredAttrnames.addAll(Arrays.asList(names)); |
400 | 400 |
} |
401 | 401 |
// Add required fields for emulated fields |
402 | 402 |
if (parent.hasEmulators) { |
403 |
// Ojo, este bucle falla cuando hay un campo calculado que depende |
|
404 |
// de otro campo calculado. |
|
403 | 405 |
for (FeatureAttributeDescriptor attrdesc : parent) { |
404 | 406 |
FeatureAttributeEmulator emulator = attrdesc.getFeatureAttributeEmulator(); |
405 |
if (emulator != null) { |
|
406 |
String ss[] = emulator.getRequiredFieldNames(); |
|
407 |
if (ss != null) { |
|
408 |
attrnames.addAll(Arrays.asList(ss)); |
|
409 |
requiredAttrnames.addAll(Arrays.asList(ss)); |
|
407 |
if (emulator != null && attrnames.contains(attrdesc.getName().toLowerCase())) { |
|
408 |
String theNames[] = emulator.getRequiredFieldNames(); |
|
409 |
if (names != null) { |
|
410 |
for (String name : theNames) { |
|
411 |
name = name.toLowerCase(); |
|
412 |
attrnames.add(name); |
|
413 |
requiredAttrnames.add(name); |
|
414 |
} |
|
410 | 415 |
} |
411 | 416 |
} |
412 | 417 |
} |
... | ... | |
415 | 420 |
if (includePk && !parent.hasOID()) { |
416 | 421 |
for (FeatureAttributeDescriptor attrdesc : parent) { |
417 | 422 |
if (attrdesc.isPrimaryKey()) { |
418 |
attrnames.add(attrdesc.getName()); |
|
419 |
requiredAttrnames.add(attrdesc.getName()); |
|
423 |
String name = attrdesc.getName().toLowerCase(); |
|
424 |
attrnames.add(name); |
|
425 |
requiredAttrnames.add(name); |
|
420 | 426 |
} |
421 | 427 |
} |
422 | 428 |
} |
... | ... | |
433 | 439 |
attrcopy.index = i++; |
434 | 440 |
} |
435 | 441 |
|
436 |
// Set the consttants attributes.
|
|
442 |
// Set the constants attributes. |
|
437 | 443 |
if (!ArrayUtils.isEmpty(constantsNames)) { |
438 | 444 |
for (String name : constantsNames) { |
439 | 445 |
if (!requiredAttrnames.contains(name)) { |
Also available in: Unified diff