package com.sample; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import org.hibernate.annotations.AccessType; @Entity @AccessType("property") @Table (name="[user]") public class User implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private int userId; private String password; private String role; private String userLoginID; private String userName; public User(int userId, String password, String role, String userLoginID, String userName) { super(); this.userId = userId; this.password = password; this.role = role; this.userLoginID = userLoginID; this.userName = userName; } public User(){ userId = -1; password = ""; role= ""; userLoginID = ""; userName = ""; } public User(int userId){ this.userId = userId; } /** * @param userId the userId to set */ public void setUserId(int userId) { // System.out.println("User ->setUserId , User Object-- " + " value - "+ this.userId + "Type " +this.getClass() ); this.userId = userId; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } /** * @param role the role to set */ public void setRole(String role) { this.role = role; } /** * @param userLoginID the userLoginID to set */ public void setUserLoginID(String userLoginID) { this.userLoginID = userLoginID; } /** * @param userName the userName to set */ public void setUserName(String userName) { this.userName = userName; } /** * @return the userId */ @Id @GeneratedValue(strategy=GenerationType.AUTO) public int getUserId() { // System.out.println("User ->getUserId , User Object-- " + " value - "+ this.userId + "Type " +this.getClass() ); return userId; } /** * @return the userLoginID */ @Column (length=45) public String getUserLoginID() { return userLoginID; } /** * @return the password */ @Column (length=20) public String getPassword() { return password; } /** * @return the userName */ @Column (length=75) public String getUserName() { return userName; } /** * @return the role */ @Column (length=45) public String getRole() { return role; } }