-->
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.  [ 1 post ] 
Author Message
 Post subject: Keep columns sequence align to sequence of entity fields
PostPosted: Fri Jun 08, 2012 11:15 am 
Newbie

Joined: Fri Jun 08, 2012 10:27 am
Posts: 1
Hi Hibernate team,

I found that when we created the tables using Hibernate, the columns sequence of the created tables is not the same with the sequence of entity fields.
And I also found most of the related source codes are using LinkedHashMap or List to keep the fields(or properties) in order, so I believe that Hibernate is aiming to keep the same sequence of the table columns as entity fields.
I traced the source codes and found that in the org.hibernate.cfg.PropertyContainer , TreeMap is used to keep the fields. I replaced all the TreeMap with LinkedHashMap, without modifing any other codes, it works -- table columns get the same order as fields defined in entity.

Hope that you will notice this post. And if it is the case, modify it in next version, then we can enjoy this.

Thanks a lot,
Ryan Wang


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

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.