]
Gail Badner commented on HHH-3783:
----------------------------------
Please attach a runnable (Java+mapping) test case that reproduces this exception.
Save throws unique constraint violation: Object having a
composite-key with constraint on one of the columns
------------------------------------------------------------------------------------------------------------
Key: HHH-3783
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3783
Project: Hibernate Core
Issue Type: Bug
Environment: HIbernate 3.2.5.ga; Database: Oracle
Reporter: Soorjith Kombilath
I have a hibernate object with composite key -
<composite-id>
<key-many-to-one name="parent" column="PARENT_NUMBER"
class="com.test.entity.impl.ParentImpl" />
<key-property name="restraintCode" column="RESTRAINT_CDE"
type="string" />
</composite-id>
In database there is a unique index on PARENT_NUMBER.
Parent object may contain a collection of chjld objects.
Whenever a child object is removed and a new child object is added, it throws unique
constraint violation error.
When I check the queries generated, hibernate is executing the queries for INSERT before
executing DELETE. Is there any way to enforce DELETE before INSERTS? or am I missing to
specify some attribute in my mapping?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: