-->
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: Saving joined sub class
PostPosted: Tue Dec 21, 2010 4:21 pm 
Newbie

Joined: Tue Dec 21, 2010 3:57 pm
Posts: 1
Hi,

Currently we are facing an issue in our project while saving a joined sub class in NHibernate it throws an exception - "a different object with the same identifier value was already associated with the session". The class Artist inherit the Account class and in db the artist table id column is the primary and foreign key column from Account.Id

HibernateMapping:
<class name="Account" table="tblAccounts">
<id name="ID">
<column name="id" sql-type="int" not-null="true"/>
<generator class="identity" />
</id>

<joined-subclass name="Artist" table="tblArtists" >
<key column="id" />
</joined-subclass>
</class>

I have removed all the property tags as it will be too long.

In our service class:

1)Initialize new Account class
2)Assign property values and save. Account saves perfectly.
3)Initialize new Artist class
4)Assign all properties and save, throws exception.

Thanks in advance for you help.


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.