This feature intended to remove/truncate fields using the Hungarian notations to the form as described in the original append. However the following changes seems to do more than just transforming a field, i.e. " name = dict.getValidColumnName(name, local);"
— openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.java 2007/11/06 07:33:44 592318
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.java 2007/11/06 07:36:55 592319
@@ -181,6 +181,12 @@
if (target instanceof Column)
name = vm.getFieldMapping().getName();
+ if (isRemoveHungarianNotation())
+ name = removeHungarianNotation(name);
+ name = dict.getValidColumnName(name, local);
col.setName(name + "_" + ((Column) target).getName());
This change has some undesired consequence that broke some previous application. Specifically, if the field is a keyword (e.g. identity), a digit is appended to the name so a foreign key column is changed from, e.g. identity_id to identity0_id. If an application already has a table defined and no automatic synchronize mapping is specified, the application will fail. This name augmentation is not warranted because even though identity is a keyword but the combined foreign key column identity_id is NOT a keyword.
My question is what is the intended purpose of this name transformation and how does it play into the "remove Hungarian Notation" feature?
As Patrick mentioned in his last note, some function in Kodo test also failed. Can this name transformation be removed ?