-->
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.  [ 7 posts ] 
Author Message
 Post subject: Transitive persistence with cascading : CascadeType.NONE ?
PostPosted: Tue Jun 20, 2006 5:27 am 
Beginner
Beginner

Joined: Fri Sep 16, 2005 7:51 am
Posts: 25
Hi,

Am I missing something ? Where is the "@CascadeType.NONE" choice from CascadeType ?

I have an object with a collection I want to fetch on demand (FetchType.LAZY), but I don't want to persist modification to this collection (link table is updated by another application) when saving the parent object.
That's why I need a 'NONE' for the CascadeType.

Any hint ?

Thanks in advance,

Sne.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 8:29 am 
Beginner
Beginner

Joined: Fri Sep 16, 2005 7:51 am
Posts: 25
I can't believe no one have something to say on that !

Come on people ! :p


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 8:32 am 
Regular
Regular

Joined: Wed Jan 11, 2006 12:49 pm
Posts: 64
Location: Campinas, Brazil
Check the API: @Cascade takes an array of CascadeType. So all you have to do to get the "CascadeType.NONE" is leave it empty, or not even mention it.

_________________
Henrique Sousa
Don't forget to rate useful responses


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 25, 2006 2:53 am 
Beginner
Beginner

Joined: Fri Sep 16, 2005 7:51 am
Posts: 25
Already tried not to mention any CascadeType at all, and it doesn't worked...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 3:28 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
What exactly doesn't work?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 4:59 am 
Beginner
Beginner

Joined: Fri Sep 16, 2005 7:51 am
Posts: 25
Associations modifications (deletion, in my case) are always persisted, even if I doesn't precise any CascadeType.
That's why I want to precise explicitelly CASCADE NONE.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 5:19 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
This is not what cascade is for.

Cascade means that the same action is used on the associated objects - in associated collection it is used on each of the elements - not as the whole collection.


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