-->
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: NonUniqueObjectException with enumerations within a set
PostPosted: Thu Mar 31, 2005 4:47 pm 
Newbie

Joined: Thu Mar 31, 2005 4:08 pm
Posts: 1
Hibernate version: 2.0.3

Mapping documents:

<hibernate-mapping>
<class name="test.Item" table="item">
<id name="uid" column="uid" type="integer" unsaved-value="any">
<generator class="increment"/>
</id>
...
<many-to-one class="test.Status" column="status" name="status" insert="true" update="true" cascade="save-update"/>
...
</class>
</hibernate-mapping>


<hibernate-mapping>
<class name="test.Status" table="status">
<id name="uid" column="uid" type="integer" unsaved-value="none">
<generator class="increment"/>
</id>
...
<one-to-one name="item" class="test.Item" property-ref="puid"/>
<property name="text" column="text" type="string" insert="false" update="false"/>
...
</class>
</hibernate-mapping>

Name and version of the database you are using: MySQL

First off, Hibernate has worked wonders for me, and I truly appreciate it...

My problem:

I have a set containing Item(s) which have a Status associted with them. The relationship from Item to Status is many-to-one. Status is just an enumeration that can be any of three different values. In my form there can be more than one Item.

When two different items have the same Status value the "NonUniqueObjectException: a different object with the same identifier value was already associated with the session:x, of class: Status".

I have looked in HIA, documentation, and forum, but haven't found an answer so far.

How do I get around this error?


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.