-->
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: Composite Primary Key order creation
PostPosted: Tue Nov 18, 2008 8:24 am 
Newbie

Joined: Mon Oct 30, 2006 1:49 pm
Posts: 2
Hi all,

I am using EJB3 with hibernate.hbm2ddl.auto=update. I notice the primary keys is been created in database in alphabetic order and not like the order defined at the embedded class. I look at the source code of Hibernate Annotations and found in AnnotationBinder class a Collections.sort at line 1024 with this comment:

Code:
//order so that property are used in the same order when binding native query


In my project I have primary keys with 4 or 5 fields, and many queries use only 2 ou 3 of them and are running very slow, and the cause was the wrong order of the primary keys in the database.

I guest that sort is for fixing another bug, but is really annoying, because I need to look each primary key and adjust its order by hand.

Is there another solution?

Thanks in advance.


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.