I realize this thread is long dead, but I would like to ask again.
At the time Max replied, I tested the 3.3.0.GA annotations jar and did not see success. I thought perhaps it was a configuration error on my part, and since this was not a vital requirement for my project, I put it aside.
It has now become more important (the DBA at my customer is complaining about diff'ing DDL scripts :))
I've now updated to hibernate-tools 3.2.0.GA (which includes hibernate-annotations-3.3.0.GA). I still see the same unsorted behavior. For example, here's the result of regenerating the schema after making a simple name change in a different table's field (via @JoinColumn(name="new_name")):
Code:
@@ -2252,8 +2252,8 @@
last_name varchar(255) not null,
password varchar(255),
username varchar(255) not null,
- portfolio_company_id integer,
user_type_id integer not null,
+ portfolio_company_id integer,
primary key (user_id),
unique (username)
);
(the diff has hundreds of these sorts of changes -- both the original and new ddl were created with the same hibernate-tools version and the only change between each DDL is a single field name change on an unrelated table.
I don't know what else to try. Here's the hiberanate.cfg.xml I'm using when running the ant task. Is there something missing in here that would cause the annotations code to sort my properties?
Code:
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping class="com.myproject.MyClass1" />
<mapping class="com.myproject.MyClass2" />
...
</session-factory>
</hibernate-configuration>
Thanks for any advice!