• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to specify cascading type using annotation

 
Jochen Gugel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

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 ...

=> not sure if this equivalent to NO ACTION

here is my actual code for this attribute


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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic