1 package org.apache.ojb.ejb; 2 3 17 18 import java.io.Serializable ; 19 import java.math.BigDecimal ; 20 21 import org.apache.commons.lang.builder.ToStringBuilder; 22 23 28 public class ArticleVO implements Serializable 29 { 30 private Integer articleId; 31 private String name; 32 private BigDecimal price; 33 private String description; 34 private Integer categoryId; 35 private CategoryVO category; 36 37 public ArticleVO(Integer articleId, String name, String description, BigDecimal price, Integer categoryId) 38 { 39 this.articleId = articleId; 40 this.name = name; 41 this.description = description; 42 this.price = price; 43 this.categoryId = categoryId; 44 } 45 46 public ArticleVO() 47 { 48 } 49 50 public CategoryVO getCategory() 51 { 52 return category; 53 } 54 55 public void setCategory(CategoryVO category) 56 { 57 this.category = category; 58 } 59 60 public Integer getArticleId() 61 { 62 return articleId; 63 } 64 65 public void setArticleId(Integer articleId) 66 { 67 this.articleId = articleId; 68 } 69 70 public String getName() 71 { 72 return name; 73 } 74 75 public void setName(String name) 76 { 77 this.name = name; 78 } 79 80 public String getDescription() 81 { 82 return description; 83 } 84 85 public void setDescription(String description) 86 { 87 this.description = description; 88 } 89 90 public BigDecimal getPrice() 91 { 92 return price; 93 } 94 95 public void setPrice(BigDecimal price) 96 { 97 if(price != null) price.setScale(2, BigDecimal.ROUND_HALF_UP); 98 this.price = price; 99 } 100 101 public Integer getCategoryId() 102 { 103 return categoryId; 104 } 105 106 public void setCategoryId(Integer categoryId) 107 { 108 this.categoryId = categoryId; 109 } 110 111 public String toString() 112 { 113 ToStringBuilder buf = new ToStringBuilder(this); 114 buf.append("articleId", articleId). 115 append("name", name). 116 append("description", description). 117 append("price", price). 118 append("categoryId", categoryId). 119 append("category", category); 120 return buf.toString(); 121 } 122 } 123 | Popular Tags |