-->
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.  [ 2 posts ] 
Author Message
 Post subject: List index part of composite key?
PostPosted: Wed Sep 30, 2009 5:19 pm 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
I have a bidirectional one-to-many between composite keys (legacy schema) that looks something like

OrderKey(customer, orderNumber)
OrderRowKey(customer, orderNumber, rowNumber)

I would think this is pretty common.

Is it possible to map the rowNumber as an index column? I know modifying primary keys is not that cool but it would be handy to be able to remove and sort order rows and have the rowNumber automagically synchronized (and preventing primary key clashes if updates are processed before deletes, as I've seen).

The problem arises when I map the @IndexColumn to the rowNumber, I keep getting a "Repeated column in mapping for entity: hib.Child column: childOrder (should be mapped with insert="false" update="false")" even if I follow the advice. If I use another (non-key) property, the list index works as intended...

Is there any way around this?

Thankful for assistance,
Nik


Top
 Profile  
 
 Post subject: Re: List index part of composite key?
PostPosted: Sun Oct 11, 2009 4:37 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
Any suggestions?


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