I have a good problem. I will return to the context.
I have a class: Siterepresenting a website, and a class User.
A site can have multiple users.
class Site {
private int site_ID;
@OneToMany
private List<User> users;
}
class User {
private int user_ID;
private String name;
private String lastname;
private String username;
private String password;
}
I want the same username to exist on all Sites, but only on the site.
Site/User/username
1 /1 /username1
1 /2 /username2
2 /3 /username1
How can i do this?
thank
source
share