1 package org.apache.ojb.broker; 2 3 public class ArticleWithNestedStockDetail implements java.io.Serializable 4 { 5 6 protected int articleId; 7 8 protected String articleName; 9 10 11 protected StockDetail stockDetail; 12 13 14 15 protected double price; 16 17 protected int productGroupId; 18 19 protected int supplierId; 20 21 22 public void addToStock(int diff) 23 { 24 stockDetail.stock += diff; 25 } 26 27 31 public int getArticleId() 32 { 33 return articleId; 34 } 35 36 40 public String getArticleName() 41 { 42 return articleName; 43 } 44 45 46 47 public double getStockValue() 48 { 49 return price * stockDetail.getStock(); 50 } 51 52 56 public void setArticleId(int newArticleId) 57 { 58 articleId = newArticleId; 59 } 60 61 65 public void setArticleName(String newArticleName) 66 { 67 articleName = newArticleName; 68 } 69 70 74 public ArticleWithNestedStockDetail() 75 { 76 } 77 78 83 public double getPrice() 84 { 85 return price; 86 } 87 88 89 94 public int getProductGroupId() 95 { 96 return productGroupId; 97 } 98 99 100 105 public int getSupplierId() 106 { 107 return supplierId; 108 } 109 110 111 116 public void setPrice(double newPrice) 117 { 118 price = newPrice; 119 } 120 121 122 127 public void setProductGroupId(int newProductGroupId) 128 { 129 productGroupId = newProductGroupId; 130 } 131 132 133 138 public void setSupplierId(int newSupplierId) 139 { 140 supplierId = newSupplierId; 141 } 142 143 144 public StockDetail getDetail() 145 { 146 return stockDetail; 147 } 148 149 150 154 public StockDetail getStockDetail() 155 { 156 return stockDetail; 157 } 158 159 163 public void setStockDetail(StockDetail stockDetail) 164 { 165 this.stockDetail = stockDetail; 166 } 167 168 } 169 | Popular Tags |