So i think i have logically figured this out, but i need assitance technically.
Logically I created another entity called AttendanceListEnt. This entity will house the user that owns this list, the event it relates to and the lsit of users.
Code:
private UserEnt user;
private EventEnt event;
private Set<UserEnt> userList = new HashSet<UserEnt>();
@ManyToOne
@JoinColumn
@NotNull
public UserEnt getUser() {
return user;
}
@Column(nullable=true)
public EventEnt getEvent() {
return event;
}
@Column(nullable=true)
public Set<UserEnt> getUserList() {
return userList;
}
In my UserEnt I added.
Code:
private Set<AttendanceListEnt> promoterInviteList = new HashSet<AttendanceListEnt>();
private Set<AttendanceListEnt> promoterAttendedList = new HashSet<AttendanceListEnt>();
private Set<AttendanceListEnt> promoterAttendingList = new HashSet<AttendanceListEnt>();
private Set<AttendanceListEnt> promoterNotAttendingList = new HashSet<AttendanceListEnt>();
@OneToMany (cascade = {CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "user", fetch=FetchType.EAGER)
@org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.SAVE_UPDATE)
public Set<AttendanceListEnt> getPromoterInviteList() {
return promoterInviteList;
}
@OneToMany (cascade = {CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "user", fetch=FetchType.EAGER)
@org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.SAVE_UPDATE)
public Set<AttendanceListEnt> getPromoterAttendedList() {
return promoterAttendedList;
}
...
I have not modified anything in the EventEnt.
Now i get this error when running.
org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: AttendanceListEnt, for columns: [org.hibernate.mapping.Column(userList)]
I think the whole set inside a set has confused me so if anyone can help me out i would highly appreciate it!
Thanks!