Hi,
I have the following class :
Code:
@Entity(access = AccessType.PROPERTY)
@Table(name = "Employee")
public class Employee implements Serializable {
/** identifier field */
@Id
@Column(name = "employee_id" ,length = 20)
private String employeeId = null;
/** version field */
@Version
private int version = 0;
/**
*
*
*/
public Employee() {
}
/**
*
* @param employeeId
*/
public Employee(String employeeId) {
this.employeeId = employeeId;
}
/**
*
* @return
*/
public int getVersion() {
return version;
}
/**
*
* @return
*/
public String getEmployeeId() {
return this.employeeId;
}
/**
*
* @param employeeId
*/
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
public String toString() {
return "EmployeeId (" + getEmployeeId() + ")";
}
}
But when I compile it, I got this error :
[junit] org.hibernate.AnnotationException: No identifier specified for entity: example.model.Employee
[junit] at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:556)
[junit] at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:174)
I've declared a mapping class in my hibernate config file :
Code:
...
<mapping class="example.model.Employee"/>
...
Anybody know what am I missing here ?
Thanks for any help/suggestion,
nusa.