mirror of https://github.com/apache/openjpa.git
OPENJPA-456 committing patch provided by Teresa Kan
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@603633 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
265be5d1bd
commit
45eb530812
|
@ -157,9 +157,15 @@ public class PersistenceMappingDefaults
|
||||||
name = inverses[0].getName();
|
name = inverses[0].getName();
|
||||||
else
|
else
|
||||||
name = fm.getDefiningMapping().getTypeAlias();
|
name = fm.getDefiningMapping().getTypeAlias();
|
||||||
|
String targetName = ((Column) target).getName();
|
||||||
|
String tempName = null;
|
||||||
|
if ((name.length() + targetName.length()) >= dict.maxColumnNameLength)
|
||||||
|
tempName = name.substring(0, dict.maxColumnNameLength
|
||||||
|
- targetName.length() - 1);
|
||||||
// suffix with '_' + target column
|
// suffix with '_' + target column
|
||||||
name += "_" + ((Column) target).getName();
|
if (tempName == null)
|
||||||
|
tempName = name;
|
||||||
|
name = tempName + "_" + targetName;
|
||||||
name = dict.getValidColumnName(name, foreign);
|
name = dict.getValidColumnName(name, foreign);
|
||||||
col.setName(name);
|
col.setName(name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue