package fi.otavanopisto.muikku.model.security; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.NotEmpty; @Entity public class Permission { /** * Returns internal unique id * * @return Internal unique id */ public Long getId() { return id; } public void setScope(String scope) { this.scope = scope; } public String getScope() { return scope; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Id @GeneratedValue (strategy = GenerationType.IDENTITY) private Long id; @NotEmpty @NotNull @Column (nullable = false, unique = true) private String name; @NotNull @Column (nullable = false) private String scope; }