How to manage a One-To-One and a One-To-Many of same type as unidirectional mapping?
- by user1652438
I'm trying to implement a model for private messages between two or more users.
That means I've got two Entities:
User
PrivateMessage
The User model shouldn't be edited, so I'm trying to set up an unidirectional relationship:
@Entity (name = "User")
@Table (name = "user")
public class User implements Serializable {
@Id
String username;
String…