Hibernate version: 3.2.6
Gday....
I'm just wondering what is the effect of using one-to-one on the many side of a one-to-many relationship.
i.e.:
Code:
public class Parent{
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="parent")
@Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
private List<Child> children;
}
public class Child{
@OneToOne
@JoinColumn(name="parent_id")
private Parent parent;
}
Just wondering.... since it seems to me that from child's perspective... it doesnt care whether the relation is one-to-one or one-to-many (it doesnt know the existence of other siblings)..
Thanks in advance... :)