-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Alphabetical column ordering with 3.3.0.GA
PostPosted: Fri Mar 30, 2007 12:21 pm 
Newbie

Joined: Wed Mar 28, 2007 4:00 pm
Posts: 7
I have upgraded Annotations from 3.2.0.ga to 3.3.0.GA. Also using Hibernate 3.2.2.ga and Hibernate Tools 3.2.0.beta8.

Since the upgrade, when generating the ddl the table columns are ordered alphabetically rather than the order established in the POJO. Is there a property setting to restore the POJO ordering? In the meantime, I have reverted to the previous Annotations version.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 6:14 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Unfortunately, there was no ordering guaranty in the previous version. Some JVM give the properties in random order which leaded to unfortunate results in clusters
http://opensource.atlassian.com/projects/hibernate/browse/ANN-551

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 9:29 am 
Beginner
Beginner

Joined: Tue Jan 18, 2005 9:37 am
Posts: 29
Location: The Netherlands
Is it currently supported to have a custom ordering for columns in the ddl?

I understand that you had to make the ordering alphabetic, to solve the random ordering problem when using different JVM's, but alphabetic ordering does not really work for me.

For example:
Suppose you have an Customer entity with the property's: lastName, firstName, mobilePhone, homePhone, faxNumber, dateOfBirth.
The property's are sorted by relevance (lastName is most important and dateOfBirth is nice to know).

When you perform a select query in the database, like select * from customer, you get a really strange result.
dateOfBirth, faxNumber, firstName, homePhone, lastName, mobilePhone.

Can't we just use the sequential POJO ordering, defined by the mapping file / annotation.

Regards,
Bas


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 6:33 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
BasvdB wrote:
Can't we just use the sequential POJO ordering, defined by the mapping file / annotation.


No we can't as it is undefined by the VM and actually behave differently (as experienced in the JIRA issue). That's why I had to follow the alphabetic order.
When do you need to use select *, you're using Hibernate ;)

The other solution is to generate the DDL in a file and change it to match your tastes when going for production.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.