updated onetomany relationship
This commit is contained in:
parent
3921fe1330
commit
6e36d7d306
1 changed files with 6 additions and 7 deletions
|
@ -1,10 +1,7 @@
|
|||
package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/** Represents a recursive invitation relationship between two users. */
|
||||
|
@ -12,11 +9,13 @@ import javax.validation.constraints.NotNull;
|
|||
public class Invited {
|
||||
|
||||
/** A host user who can invite guests to their smart house */
|
||||
@OneToMany private Set<User> host;
|
||||
@OneToMany(mappedBy = "host")
|
||||
private Set<User> host;
|
||||
|
||||
/** Guests that have been invited to the host's house */
|
||||
@OneToMany(mappedBy = "host", orphanRemoval = true)
|
||||
private Set<User> guest;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "guests")
|
||||
private User guest;
|
||||
|
||||
/** Host ID */
|
||||
@Id
|
||||
|
|
Loading…
Reference in a new issue