-->
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.  [ 3 posts ] 
Author Message
 Post subject: DiscriminatorColumn always first column?
PostPosted: Thu Jun 07, 2007 12:58 pm 
Newbie

Joined: Thu Jun 07, 2007 12:45 pm
Posts: 4
Location: eastern USA
When I map a class hierarchy with the table-per-class hierarchy mapping, a discriminator column is created as the first column in the table definition that Hibernate creates. Is there a way to make the primary key (ID field in the Abstract entity class) be the first column, and the discriminator column the second column. This is purely aesthetic, having no impact on the function. Thanks for a wonderfully useful project!

_________________
SQuirreL SQL (http://www.squirrelsql.org)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 1:32 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Well, it can be easily placed in the beginning or in the end, but I don't want to have it in the end.
Placing it in between is much harder. Does it worth it? I believe it does not :)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 2:48 pm 
Newbie

Joined: Thu Jun 07, 2007 12:45 pm
Posts: 4
Location: eastern USA
No it isn't a big problem. I'm just used to seeing primary keys as the first column. Some dbs (like MySQL - I think) have the ability to change the natural ordering of the columns, so it could be possible in those cases to have an additional table alter command to come behind the create statement to adjust column ordering. But it's probably not widely enough supported operation to merit a Hibernate feature request. Thanks for confirming at least that it isn't currently implemented.

_________________
SQuirreL SQL (http://www.squirrelsql.org)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.