-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem using Cascade option for Many to one - unique
PostPosted: Tue Nov 21, 2006 2:31 am 
Newbie

Joined: Tue Nov 21, 2006 2:14 am
Posts: 7
Location: Chennai, India
i am having one master table which are connected to four child tables.

i have used many to one relationship with unique=true for specifying the realtionship for all four tables.

my scenario is like this

    Insert - Insert into all child tables
    Update - No update for child tables
    Delete - not used in the application
    Select - Select from all child tables

i have used lazy=false to fetch the details from master table.

currently i am using cascade = all for all tables and this is working fine for insert.

my isssue is that it updates the child tables also when i want to update the master table details alone. (my database connectivity is slow, so it does four unneccessary hits to the database)

is there any option to limit the cascade to insert only


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 4:44 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
cascade="persist" is the equivalent of cascading only during insert. Check out
http://www.hibernate.org/hib_docs/v3/re ... transitive


Top
 Profile  
 
 Post subject: Not working
PostPosted: Tue Nov 21, 2006 10:04 am 
Newbie

Joined: Tue Nov 21, 2006 2:14 am
Posts: 7
Location: Chennai, India
nice solution but it does not solve my problem

it does not solve my problem as i have to use the save() method and not the persist(). i require the generated identifier to be displayed on the next page.

as i cannot use persist(), is there anyother way, all i can see is save or update() nothing for save() alone.


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