-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Why can't compile java file?
PostPosted: Tue Oct 14, 2014 9:36 am 
Newbie

Joined: Thu Oct 09, 2014 8:05 am
Posts: 6
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


Top
 Profile  
 
 Post subject: Re: Why can't compile java file?
PostPosted: Tue Oct 14, 2014 10:21 am 
Newbie

Joined: Thu Oct 09, 2014 8:05 am
Posts: 6
I get the answer,I missing method
public Integer getId() {
return id;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.