-->
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: Hibernate deleting from and reordering a DB
PostPosted: Tue Oct 09, 2007 4:23 am 
Newbie

Joined: Tue Oct 09, 2007 4:21 am
Posts: 1
Ok so im having a world of trouble at the moment with my DB and hibernate (also this may be very obvious but im new to hibernate).
i am working with the current table structure below, which i know isnt great but that what ive been given.
Im trying to delete elements from my database and have them cascade down and thats working.
The problem is my keys are numbered sequecially and i use these key values to show on my screen. Now my problem is when i delete something in table 2.
For example i have 5 items in that table and i delete 2 and 4 i am not sure how to reorder that table so now i have elements 1 2 and 3.
Ive tried to just set my elements to different numbers say change element 3s table2key to 2 but no go.
Ive also tried to strip all the elements out and put them back in one at a time but then it tries to put the 3rd tables elements into the DB before the second and of course it fails as table 2 has no corresponding entries.
sorry if this is a bad explaination
but can anyone help, or at least try to figure out what im saying.
I will be watching the boards if any more clarification is sought.
thanks
josef


table 1
table1Key
element 1
element 2
element 3
element 4

table 2
table1Key
table2Key
element 1
element 2

table 3
table1Key
table2Key
table3Key
element 1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 09, 2007 10:46 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
I didn't get the problem exactly. Would be better if you can post your mappings and a concrete example with some data.


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.