[
http://opensource.atlassian.com/projects/hibernate/browse/ANN-673?page=co...
]
Emmanuel Bernard resolved ANN-673.
----------------------------------
Resolution: Fixed
Unfortunately I can no longer use your patch as path is not available anymore.
I no longer use the VM hashCode for comparison thanks to ANN-683.
I believe the ordering is now predictable.
Let me know if it's not the case.
Guaranty column order in genereted schema
-----------------------------------------
Key: ANN-673
URL:
http://opensource.atlassian.com/projects/hibernate/browse/ANN-673
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.0.ga
Environment: Hibernate 3.2.1 and SVN, PostgreSQL 8.1
Reporter: Ivo Danihelka
Priority: Minor
Fix For: 3.3.1
Attachments: fk-order.path
Problem:
- AnnotationConfiguration does not define stable ordering for foreign key columns. They
then could appear in generated SQL schema in any order. For example, sometimes table
foreign key column person_id is before another foreign key column dog_id and sometimes it
is behind it.
Tool hbm2ddl could be used to see the generated schema. The order of foreign key columns
in one table changes
when unrelated change is made inside mapping of a different table.
Proposed Solution:
- Don't base the ordering of foreign keys on hashCode. Base it on
tableName+propertyName.
A patch against hibernate 3.2.1 is attached (it also backportes #ANN-551 into 3.2.1).
--
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