1 package org.hibernate.test.filter; 3 4 9 public class LineItem { 10 private Long id; 11 private Order order; 12 private int sequence; 13 private Product product; 14 private long quantity; 15 16 LineItem() {} 17 18 public static LineItem generate(Order order, int sequence, Product product, long quantity) { 19 LineItem item = new LineItem(); 20 item.order = order; 21 item.sequence = sequence; 22 item.product = product; 23 item.quantity = quantity; 24 item.order.getLineItems().add(sequence, item); 25 return item; 26 } 27 28 public Long getId() { 29 return id; 30 } 31 32 public void setId(Long id) { 33 this.id = id; 34 } 35 36 public Order getOrder() { 37 return order; 38 } 39 40 public void setOrder(Order order) { 41 this.order = order; 42 } 43 44 public int getSequence() { 45 return sequence; 46 } 47 48 public void setSequence(int sequence) { 49 this.sequence = sequence; 50 } 51 52 public Product getProduct() { 53 return product; 54 } 55 56 public void setProduct(Product product) { 57 this.product = product; 58 } 59 60 public long getQuantity() { 61 return quantity; 62 } 63 64 public void setQuantity(long quantity) { 65 this.quantity = quantity; 66 } 67 } 68 | Popular Tags |