package hibernateTest.entities; import hibernateTest.models.Groups; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class User { public String uId, uri, name, pw, iconUri; public boolean login = true; public Set<Group> groups = new HashSet<>();//HashSetでいいのかな? public User(){ } public User(String name, String uId,String uri,String pw,String iconUri) { setuId(uId); setUri(uri); setName(name); setPw(pw); setIconUri(iconUri); } public String getuId() { return uId; } public void setuId(String uId) { this.uId = uId; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPw() { return pw; } public void setPw(String pw) { this.pw = pw; } public String getIconUri() { return iconUri; } public void setIconUri(String iconUri) { this.iconUri = iconUri; } public boolean getLogin() { return login; } public void setLogin(boolean login) { this.login = login; } public Set<Group> getGroups() { return groups; } public void setGroups(Set<Group> groups) { this.groups = groups; } public void addGroups(Group group){ //テスト用 //Group group = Groups.getInstance().getGroupByGid(gId); groups.add(group); } }