I have a java file,like follows:
Code:
package demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="EMPLOYEE")
public class EmployeeEntity {
@Id
@Column(name="ID")
@GeneratedValue
private Integer id;
@Column(name="FIRSTNAME")
private String firstname;
@Column(name="LASTNAME")
private String lastname;
@Column(name="EMAIL")
private String email;
@Column(name="TELEPHONE")
private String telephone;
}
Then I use it in another java file
Code:
import demo.entity.EmployeeEntity;
import demo.service.EmployeeManager;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
public class EditEmployeeAction extends ActionSupport implements Preparable{
private EmployeeEntity employee;
public String deleteEmployee() {
logger.info("deleteEmployee method called");
employeeManager.deleteEmployee(employee.getId());
return SUCCESS;
}
When I use ant build command to compile above code,it raise following error:
can't find method employee.getId()
Why can't I compile java file? Missing jar file or xml file? Where is wrong? How to correct it?
Thanks