package northwind.jpamodel; import java.math.BigDecimal; import java.util.Date; 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; import javax.persistence.Version; @Entity public class User { private long id; private String userName; private String userPassword; private String firstName; private String lastName; private String email; private Long rowVersion; private String createdBy; private long createdByUserId; private Date createdDate; private String modifiedBy; private long modifiedByUserId; private Date modifiedDate; private Set<UserRole> userRoles; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) public long getId() { return id; } public void setId(long id) { this.id = id; } @Column(length=100, nullable=false) public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } @Column(length=200) public String getUserPassword() { return userPassword; } public void setUserPassword(String userPassword) { this.userPassword = userPassword; } @Column(length=100, nullable=false) public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } @Column(length=100, nullable=false) public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } @Column(length=100, nullable=false) public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Version public Long getRowVersion() { return rowVersion; } public void setRowVersion(Long rowVersion) { this.rowVersion = rowVersion; } @Column(length=100, nullable=false) public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public long getCreatedByUserId() { return createdByUserId; } public void setCreatedByUserId(long createdByUserId) { this.createdByUserId = createdByUserId; } @Column(nullable=false) public Date getCreatedDate() { return createdDate; } public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } @Column(length=100, nullable=false) public String getModifiedBy() { return modifiedBy; } public void setModifiedBy(String modifiedBy) { this.modifiedBy = modifiedBy; } public long getModifiedByUserId() { return modifiedByUserId; } public void setModifiedByUserId(long modifiedByUserId) { this.modifiedByUserId = modifiedByUserId; } @Column(nullable=false) public Date getModifiedDate() { return modifiedDate; } public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } @OneToMany(mappedBy="user") public Set<UserRole> getUserRoles() { return userRoles; } public void setUserRoles(Set<UserRole> userRoles) { this.userRoles = userRoles; } }