I\'ve the following entity:
@Entity
public class Employee implements Serializable{
private static final long serialVersionUID = 3454567L;
@Id
@G
Your class should have the fields mapped to the table column using annotation like
@Entity
@Table(name="employee")
public class Employee implements Serializable{
private static final long serialVersionUID = 3454567L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@cloumn(name="emp_id")
private int empId;
@Column(name="user_name")
private String username;
public int getEmpId() {
return empId;
}
public void setEmpId(int empId) {
this.empId = empId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}