View Javadoc
1   package ejava.examples.jndidemo.bo;
2   
3   import javax.persistence.Entity;
4   import javax.persistence.Id;
5   import javax.persistence.Table;
6   
7   @Entity
8   @Table(name="JNDI_TASK")
9   public class Task {
10  	@Id
11  	private int id;
12  	private String name;
13  	
14  	
15  	public Task() {}
16  	public Task(int id, String name) {
17  		this.id = id;
18  		this.name = name;
19  	}
20  	
21  	public int getId() {
22  		return id;
23  	}
24  	public void setId(int id) {
25  		this.id = id;
26  	}
27  	public String getName() {
28  		return name;
29  	}
30  	public void setName(String name) {
31  		this.name = name;
32  	}
33  
34  	@Override
35  	public String toString() {
36  		StringBuilder builder = new StringBuilder();
37  		builder.append("id=").append(id)
38  		       .append(", name=").append(name);
39  		return builder.toString();
40  	}
41  }