-->
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: Dodgy Legacy tables and composite foriegn keys
PostPosted: Wed Jun 14, 2006 4:33 am 
Beginner
Beginner

Joined: Tue Oct 05, 2004 5:15 am
Posts: 23
Im working with some old database tables which I cant change.
Each table has a primary key field - which is just obtained from a sequence.
This field in each table has no business meaning.
There are logical relationships between the tables - which should have been defined as foriegn keys (note the relationships have nothing to do with the ID fields - they are based on "business" fields).
There are no foreign keys defined in the database.

Im trying to decide whether hibernate will be a good choice in this scenario...

Will I still be able to do collection mappings based on the fields even though there are no FKs?
Am I likely to hit problems due to the fact that the primary key fields (ID) wont be used as the fields in collection joins?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 14, 2006 11:17 am 
Beginner
Beginner

Joined: Tue Oct 05, 2004 5:15 am
Posts: 23
Never mind.....

Pulled some strings and got it agreed that surrogate keys and FKs can be added to each table.


Top
 Profile  
 
 Post subject: i'm doing something similar
PostPosted: Thu Jun 15, 2006 11:23 am 
Newbie

Joined: Thu Jun 15, 2006 6:46 am
Posts: 5
i'm doing something similar. I have a master table with it's own PK a sequence generated number in sql server. however the child records are in a table linked by two fields and ordered by a third, account,order and line number. The child record s also have a database generated sequence id. I'm failing miserably to get composites to work with this stuff...

HELP!!!!!!!!!!!!!!!!!!!!!!!!!!1

_________________
I'm addicted to VBoost...


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.