1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.customer; 26 27 import java.io.Serializable ; 28 29 import javax.persistence.CascadeType; 30 import javax.persistence.Entity; 31 import javax.persistence.Id; 32 import javax.persistence.ManyToOne; 33 34 40 @Entity 41 public class Product implements Serializable { 42 43 46 private static final long serialVersionUID = 2265810991046125943L; 47 48 51 private long id; 52 53 56 private String description; 57 58 61 private float price; 62 63 66 private Category category; 67 68 71 private ProductOrder order; 72 73 81 public Product(final long id, final String description, final float price, final Category category, 82 final ProductOrder order) { 83 this.id = id; 84 this.description = description; 85 this.price = price; 86 this.category = category; 87 this.order = order; 88 } 89 90 97 public Product(final long id, final String description, final float price, final Category category) { 98 this.id = id; 99 this.description = description; 100 this.price = price; 101 this.category = category; 102 } 103 104 108 public Product() { 109 110 } 111 112 116 @ManyToOne 117 public ProductOrder getOrder() { 118 return order; 119 } 120 121 125 public void setOrder(final ProductOrder order) { 126 this.order = order; 127 } 128 129 133 public String getDescription() { 134 return description; 135 } 136 137 141 public void setDescription(final String description) { 142 this.description = description; 143 } 144 145 149 @Id 150 public long getId() { 151 return id; 152 } 153 154 158 public void setId(final long id) { 159 this.id = id; 160 } 161 162 166 public float getPrice() { 167 return price; 168 } 169 170 174 public void setPrice(final float price) { 175 this.price = price; 176 } 177 178 182 @ManyToOne(cascade = CascadeType.REFRESH) 183 public Category getCategory() { 184 return category; 185 } 186 187 191 public void setCategory(final Category category) { 192 this.category = category; 193 } 194 195 } 196 | Popular Tags |