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.