I think this link can help you with the problem: http://stackoverflow.com/questions/2563755/ensuring-inserts-after-a-call-to-a-custom-nhibernate-iidentifiergenerator
You can implement the IIdentifierGenerator to specify how the primary key is composed. On Mar 27, 6:05 am, Huzefa Kagdi <[email protected]> wrote: > 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. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
