[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-dev] Bug fix for TableDefinition.buildForeignKeyConstraintName
|
Hi Gregor,
Thanks for looking into the fix.
Because of Eclipse Foundation rules, in order for us to accept the changed
code, it must be submitted through Bugzilla.
(https://bugs.eclipse.org/bugs/query.cgi)
-Tom
Gregor Zeitlinger wrote:
Hi,
I've fixed a but in TableDefinition that is apparently filed in
glassfish, but not fixed there
(see https://glassfish.dev.java.net/issues/show_bug.cgi?id=3554)
The bug still exists in the 2.0 nightly snapshot.
if (foreignKeyName.length() > maximumNameLength) {
// Still too long: remove vowels from the table
name and field name and truncate the table name.
String shortenedFieldName =
Helper.removeVowels(onlyAlphaNumericFieldName);
String shortenedTableName =
Helper.removeVowels(onlyAlphaNumericTableName);
foreignKeyName =
Helper.truncate(shortenedTableName, maximumNameLength -
shortenedFieldName.length()) + shortenedFieldName;
}
becomes
if (foreignKeyName.length() > maximumNameLength) {
// Still too long: remove vowels from the table
name and field name and truncate the table name.
String shortenedFieldName =
Helper.removeVowels(onlyAlphaNumericFieldName);
String shortenedTableName =
Helper.removeVowels(onlyAlphaNumericTableName);
if (shortenedFieldName.length() >=
maximumNameLength) {
foreignKeyName =
Helper.truncate(shortenedFieldName, maximumNameLength);
} else {
foreignKeyName =
Helper.truncate(shortenedTableName, maximumNameLength -
shortenedFieldName.length()) + shortenedFieldName;
}
}
Gregor
------------------------------------------------------------------------
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev