Foreign key constraint names in reveng xml
------------------------------------------
Key: HBX-813
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-813
Project: Hibernate Tools
Type: Improvement
Components: reverse-engineer
Versions: 3.2beta8
Environment: Hibernate 3.2GA, Oracle 10g
Reporter: Eric Kershner
The requirement for the constraint-name property in the foreign-key element may not be
necessary. The OverrideBinder.bindForeignKeys method ignores the <foreign-key>
directives silently if the constraint-name is not specified. However, the foreign key is
already created by this time using Table.createForeignKey, which generates a constraint
name using Table.uniqueColumnString. This should generate a unique constraint name since
it is based on the referenced entity and the fk columns. This would eliminate the
necessity to specify a constraint-name property, which can be inconvenient when mapping a
lot of foreign keys which were not specified in the schema. Changes would include:
changing the documentation to reflect the fact that the constraint-name is optional and
would be generated if not specified; remove the StringHelper.isNotEmpty(constraintName)
check in the OverrideBinder.bindForeignKeys. A check for duplicate foreign key constraint
names already exists in the JDBCReader.processForeignKeys (where it throws an unchecked
MappingException).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira