1 package ejava.examples.cdiconfig.bo; 2 3 import java.io.Serializable; 4 5 import javax.persistence.Entity; 6 import javax.persistence.GeneratedValue; 7 import javax.persistence.GenerationType; 8 import javax.persistence.Id; 9 import javax.persistence.Table; 10 11 @Entity 12 @Table(name="CDICFG_TASK") 13 public class Task implements Serializable { 14 private static final long serialVersionUID = 1L; 15 @Id @GeneratedValue(strategy=GenerationType.IDENTITY) 16 private int id; 17 private String name; 18 19 20 public Task() {} 21 public Task(String name) { 22 this.name = name; 23 } 24 25 public int getId() { 26 return id; 27 } 28 public void setId(int id) { 29 this.id = id; 30 } 31 public String getName() { 32 return name; 33 } 34 public void setName(String name) { 35 this.name = name; 36 } 37 38 @Override 39 public String toString() { 40 StringBuilder builder = new StringBuilder(); 41 builder.append("id=").append(id) 42 .append(", name=").append(name); 43 return builder.toString(); 44 } 45 }