-->
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.  [ 2 posts ] 
Author Message
 Post subject: Map Delete updates Index Column to Null
PostPosted: Tue Aug 10, 2010 3:01 pm 
Newbie

Joined: Tue Aug 10, 2010 2:52 pm
Posts: 2
I have a table called task_definition. Each taskdefinition has several attributes; represented using the following mapping
Code:
<map name="taskAttributes" table="ABSTRACT_PROJ_ATTR" cascade="all"
         lazy="true" where="TASK_DEFINITION_ID is not null">
         <key column="TASK_DEFINITION_ID"  />
         <index type="string" column="ATTR_NAME"  />
         <one-to-many
            class="com.AttributeDAO" />
      </map>


When I delete a taskDefinition I get following error. Hibernate tries to update the index column attr_name to null.

Code:
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [update ABSTRACT_PROJ_ATTR set TASK_DEFINITION_ID=null, ATTR_NAME=null where TASK_DEFINITION_ID=? and TASK_DEFINITION_ID is not null]; SQL state [72000]; error code [1407]; ORA-01407: cannot update ("_JBPM"."ABSTRACT_PROJ_ATTR"."ATTR_NAME") to NULL


I want the attribute to be deleted. Please help I'm new to hibernate.


Top
 Profile  
 
 Post subject: Re: Map Delete updates Index Column to Null
PostPosted: Wed Aug 11, 2010 2:15 pm 
Newbie

Joined: Tue Aug 10, 2010 2:52 pm
Posts: 2
adding inverse="true" on the relationship fixed the issue


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.