-->
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: cascading question
PostPosted: Fri May 21, 2004 5:24 am 
JBoss jBPM Developer
JBoss jBPM Developer

Joined: Thu Aug 28, 2003 11:56 am
Posts: 30
Location: Belgium
Hi,

consider following 3 classes :

Code:
public class Obj1 {
  private Long id = null;
  private Obj2 obj2 = null; // mapped with cascades="true"
  ...
}

public class Obj2 {
  private Long id = null;
  private Map threes = null; // mapped with cascades="true"
  ...
}

public class Obj3 {
  private Long id = null;
  ...
}

... means : imagine the getters and setters


scenario 1)
obj1 --> obj2 --> obj3
save( obj1 ) results in all 3 objects getting an id.

scenario 2)
obj1 --> obj2
save( obj1 ) results in all obj1 and obj2 getting an id.
obj1 --> obj2 --> obj3
save( obj1 ) does *not* give obj3 and id.

is this normal behaviour ?
can I configure hibernate so that obj3 in the second scenario is given an id ?

Regards, Tom.


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.