-->
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.  [ 1 post ] 
Author Message
 Post subject: unable to specify cascading type using annotation
PostPosted: Tue Feb 24, 2009 10:41 am 
Newbie

Joined: Mon Feb 23, 2009 7:52 am
Posts: 2
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


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

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.