oops..a little bit confusing, not? :)
Simple Example
Code:
class Person{
private List<Address> addy;
// getters and setters for addy
}
class Address{
private String street;
// getters and setters
}
and now..
Code:
List<Address> addresses = new ArrayList<Address>();
addresses.add(new Address());
addresses.add(new Address());
Person p1 = new Person();
p1.setAddy(addresses);
Person p2 = new Person();
p2.setAddy(addresses);
getSession().save(p1);
getSession().save(p2);
All references are mapped with cascade="all".
How to do this?
Kind regards
Sebastian