1 7 package org.jboss.tutorial.entity.bean; 8 9 import javax.persistence.Entity; 10 import javax.persistence.GeneratorType; 11 import javax.persistence.Id; 12 import javax.persistence.JoinColumn; 13 import javax.persistence.ManyToOne; 14 import javax.persistence.Entity; 15 16 @Entity 17 public class LineItem implements java.io.Serializable 18 { 19 private int id; 20 private double subtotal; 21 private int quantity; 22 private String product; 23 private Order order; 24 25 26 @Id(generate = GeneratorType.AUTO) 27 public int getId() 28 { 29 return id; 30 } 31 32 public void setId(int id) 33 { 34 this.id = id; 35 } 36 37 public double getSubtotal() 38 { 39 return subtotal; 40 } 41 42 public void setSubtotal(double subtotal) 43 { 44 this.subtotal = subtotal; 45 } 46 47 public int getQuantity() 48 { 49 return quantity; 50 } 51 52 public void setQuantity(int quantity) 53 { 54 this.quantity = quantity; 55 } 56 57 public String getProduct() 58 { 59 return product; 60 } 61 62 public void setProduct(String product) 63 { 64 this.product = product; 65 } 66 67 @ManyToOne 68 @JoinColumn(name = "order_id") 69 public Order getOrder() 70 { 71 return order; 72 } 73 74 public void setOrder(Order order) 75 { 76 this.order = order; 77 } 78 } 79 | Popular Tags |