package ciai.model; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import com.fasterxml.jackson.annotation.JsonView; import ciai.view.Views; import tools.AccountRole; @Entity public class Role { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @JsonView(Views.ProfessorView.class) private AccountRole description; @OneToMany(mappedBy = "role", cascade = CascadeType.ALL) private Set accounts; public Role(){} public Role(AccountRole role){ this.setDescription(role); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public AccountRole getDescription() { return description; } public void setDescription(AccountRole description) { this.description = description; } }