Hi guys,
We are developing an java web application and use DB2 as database.
For o/r mapping we use hibernate in version 3.2.6 ga
Furthermore the mapping is specified using hibernate annotations in version 3.3.1 GA.
In this context we have several tables where objects have a relationship to object of the same table e.g. an opportunity has an attribute parent, which is an other opportunity object.
Hibernate creates accordingly an alter statement which looks like this
alter table OPPORTUNITY add constraint FK_PARENT_AT_OPPOTUNITY foreign key (PARENT_ID) references OPPORTUNITY
Unfortunately DB2 needs the information how to handle this foreign key during deletion of entries.
We want to specify NO ACTION for such situations.
But how to achieve that?
I already tried different possibilities to define the cascading type with the use annotations, but none of them worked.
already tried ...
@OnDelete(action=OnDeleteAction.NO_ACTION ),
@Cascade( { org.hibernate.annotations.CascadeType.REFRESH } ) => not sure if this equivalent to NO ACTION
http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#entity-hibspec-cascade
In this context we have different relation types like
@ManyToOne,
@OneToOne,
@OneToMany
Any help appreciated
Kind regards
Jochen