Type: New Feature
Affects Version/s: 3.0-M3
Fix Version/s: 3.0-RC1
AndromMDA RC1 latest build
We're using Hibernate's SchemaExport tool to generate the database schema SQL script.
By default, this tool names foreign key constraints as follows:
FK + hash(table name) + hash(column name)
This guarantees the foreign key constraint name uniqueness, but really isn't meaningful when used in foreign key constraint violation error messages (e.g.: FK78191C2991B).
It isn't possible to use a custom NamingStrategy, like for table and column names,
but it is still possible to override the default name by adding a 'foreign-key' attribute on the following elements of the Hibernate mapping file (See Hibernate Reference chapter 15): <one-to-one>, <many-to-one>, <key>, and <many-to-many>.
I think AndroMDA could make a good use of association-end names to generate meaningful unique names for foreign key constraints or use a naming pattern like: fk + table name + column name.