what is the difference between owned one to many relationship and owned one to many bidirectional relationship i read the article below but i don't understand it. Article
The owned one to many bidirectional relationship just means that the children have a reference to the parent. For example, the child below can access the parent via persistentUser. If persistentUser didn't exist in the PersistentLogin class then it would not be bidirectional.
One-to-Many (PersistentUser.java - Parent):
@OneToMany(mappedBy = "persistentUser", cascade = CascadeType.ALL)
private Collection<PersistentLogin> persistentLogins;
Many-to-One (PersistentLogin.java - Child):
@ManyToOne(fetch = FetchType.LAZY)
private PersistentUser persistentUser;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With