1 25 26 package org.objectweb.easybeans.tests.common.ejbs.entity.book; 27 28 import javax.persistence.Entity; 29 import javax.persistence.Id; 30 import javax.persistence.Table; 31 32 33 39 @Entity 40 @Table(name = "BOOK") 41 public class Book implements java.io.Serializable { 42 43 46 private static final long serialVersionUID = 1350259495852814154L; 47 48 51 private int id; 52 53 56 private String name; 57 58 61 private String author; 62 63 66 public Book(){ 67 } 68 69 75 public Book(final int id, final String name, final String author){ 76 setId(id); 77 setName(name); 78 setAuthor(author); 79 } 80 81 85 @Id 86 public int getId() { 87 return id; 88 } 89 90 94 public void setId(final int id) { 95 this.id = id; 96 } 97 98 102 public void setName(final String name) { 103 this.name = name; 104 } 105 106 110 public String getName() { 111 return name; 112 } 113 114 118 @Override 119 public String toString() { 120 StringBuilder sb = new StringBuilder (); 121 sb.append("Book[id=").append(id).append(", name=").append(getName()).append("]"); 122 return sb.toString(); 123 } 124 125 129 public String getAuthor() { 130 return author; 131 } 132 133 137 public void setAuthor(final String author) { 138 this.author = author; 139 } 140 141 } 142 | Popular Tags |