package northwind.jpamodel; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; @Entity public class Role { private long id; private String name; private String description; private byte[] ts; private RoleType roleType; private Set<UserRole> userRoles; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) public long getId() { return id; } public void setId(long id) { this.id = id; } @Column(length=50, nullable=false) public String getName() { return name; } public void setName(String name) { this.name = name; } @Column(length=2000) public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public byte[] getTs() { return ts; } public void setTs(byte[] ts) { this.ts = ts; } public RoleType getRoleType() { return roleType; } public void setRoleType(RoleType roleType) { this.roleType = roleType; } @OneToMany(mappedBy="role") public Set<UserRole> getUserRoles() { return userRoles; } public void setUserRoles(Set<UserRole> userRoles) { this.userRoles = userRoles; } }