-->
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: NHibernate: Problem Mapping Composite IDs
PostPosted: Sun Mar 27, 2011 5:03 am 
Newbie

Joined: Sun Mar 27, 2011 4:36 am
Posts: 1
Hi,

We have got a strange scenario to map in NHibernate. The database that we are using is Oracle 10g. One of the Parent Table has a Primary Key that is made up of two columns- 1) ID and 2) A Number Defining the Year and Month (not Date). Also this Primary Key acts as a Foreign Key (as well as Primary Key) to all other child tables (fifteen in number). The design is such that there is a Parent Table having all the Transactions (generic information) and then there are Child Tables that actually refer to particular type of transactions (having transaction specific information).

The problem we have is that we checked that the table has a Sequence attached to it. But the Sequence is designed only for the ID column. Sequence is used only for one column but the table takes two columns as its Primary Key. So how do I write the mapping file for the id tag? Any suggestions would be welcomed.

Just would like to add that redesigning the database is unfortunately not a option that we have. We have to adhere to this design.


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.