package fi.otavanopisto.pyramus.domainmodel.security; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.TableGenerator; 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.TABLE, generator="Permission") @TableGenerator(name="Permission", allocationSize=1, table = "hibernate_sequences", pkColumnName = "sequence_name", valueColumnName = "sequence_next_hi_value") private Long id; @NotEmpty @NotNull @Column (nullable = false, unique = true) private String name; @NotNull @Column (nullable = false) private String scope; }