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.