1 22 package org.jboss.ejb3.test.asynchronous; 23 24 import javax.persistence.Entity; 25 import javax.persistence.Id; 26 import javax.persistence.GeneratedValue; 27 import javax.persistence.GenerationType; 28 29 33 @Entity 34 public class Vegetable 35 { 36 private int id; 37 private String name; 38 39 public Vegetable() 40 { 41 42 } 43 44 public Vegetable(String name) 45 { 46 this.name = name; 47 } 48 49 @Id 50 @GeneratedValue(strategy= GenerationType.AUTO) 51 public int getId() 52 { 53 return id; 54 } 55 56 public void setId(int id) 57 { 58 this.id = id; 59 } 60 61 public String getName() 62 { 63 return name; 64 } 65 66 public void setName(String name) 67 { 68 this.name = name; 69 } 70 71 public String toString() 72 { 73 return id + "-" + name; 74 } 75 } 76 | Popular Tags |