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.  [ 5 posts ] 
Author Message
 Post subject: How do I set cascade styles at runtime?
PostPosted: Wed Aug 10, 2005 4:19 pm 
Newbie

Joined: Thu Apr 28, 2005 8:16 pm
Posts: 9
I would like to set cascade styles at runtime for certain associations. But I want to set the cascade style on a per-Hibernate session basis, not globally.

For example, the XML mapping for an association may specify cascade="none", but, just for a particular Hibernate session, I want to set the cascade style to cascade="all, delete-orphan".

What is the easiest way to set association cascade styles at runtime and on a per-Hibernate session basis?

Geoff


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 4:56 pm 
Newbie

Joined: Fri Jan 07, 2005 5:46 pm
Posts: 19
You may want to look at section 4.4. Lifecycle Callbacks in the reference documentation:

...
onSave(), onDelete() and onUpdate() may be used to cascade saves and deletions of dependent objects. This is an alternative to declaring cascaded operations in the mapping file.
...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 9:14 am 
Newbie

Joined: Thu Apr 28, 2005 8:16 pm
Posts: 9
I would prefer to be able to set cascade styles at runtime by manipulating metadata. I am seeking to do something similar to what is described in Section 3.3.4: Manipulating metadata at runtime of HIA.

Does anybody have any advice concerning how to extend the example in Section 3.3.4 of HIA to include setting cascade styles of an association?


Top
 Profile  
 
 Post subject: Re: How do I set cascade styles at runtime?
PostPosted: Wed Sep 22, 2010 10:45 am 
Newbie

Joined: Fri Jan 27, 2006 1:48 am
Posts: 9
I was wondering if there was any concrete examples of a solution to this issue [RE: set cascade art run time]

The Reference doc does make this reference [Chapter 4 Persistent Classes: Section 4.4 LifeCycle Callbacks]:

onSave(), onDelete() and onUpdate() may be used to cascade saves and deletions of dependent objects. This is an alternative to declaring cascaded operations in the mapping file.

Anyone have any pointers to an example/how-to/implementation ?


Top
 Profile  
 
 Post subject: Re: How do I set cascade styles at runtime?
PostPosted: Fri Oct 01, 2010 4:07 pm 
Newbie

Joined: Fri Jan 27, 2006 1:48 am
Posts: 9
I posted a possible solution here:

viewtopic.php?f=1&t=990537


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.