001: package org.apache.ojb.ejb;
002:
003: /* Copyright 2003-2005 The Apache Software Foundation
004: *
005: * Licensed under the Apache License, Version 2.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: import java.io.Serializable;
019: import java.math.BigDecimal;
020:
021: import org.apache.commons.lang.builder.ToStringBuilder;
022:
023: /**
024: *
025: * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
026: * @version $Id: ArticleVO.java,v 1.6.2.1 2005/12/21 22:21:38 tomdz Exp $
027: */
028: public class ArticleVO implements Serializable {
029: private Integer articleId;
030: private String name;
031: private BigDecimal price;
032: private String description;
033: private Integer categoryId;
034: private CategoryVO category;
035:
036: public ArticleVO(Integer articleId, String name,
037: String description, BigDecimal price, Integer categoryId) {
038: this .articleId = articleId;
039: this .name = name;
040: this .description = description;
041: this .price = price;
042: this .categoryId = categoryId;
043: }
044:
045: public ArticleVO() {
046: }
047:
048: public CategoryVO getCategory() {
049: return category;
050: }
051:
052: public void setCategory(CategoryVO category) {
053: this .category = category;
054: }
055:
056: public Integer getArticleId() {
057: return articleId;
058: }
059:
060: public void setArticleId(Integer articleId) {
061: this .articleId = articleId;
062: }
063:
064: public String getName() {
065: return name;
066: }
067:
068: public void setName(String name) {
069: this .name = name;
070: }
071:
072: public String getDescription() {
073: return description;
074: }
075:
076: public void setDescription(String description) {
077: this .description = description;
078: }
079:
080: public BigDecimal getPrice() {
081: return price;
082: }
083:
084: public void setPrice(BigDecimal price) {
085: if (price != null)
086: price.setScale(2, BigDecimal.ROUND_HALF_UP);
087: this .price = price;
088: }
089:
090: public Integer getCategoryId() {
091: return categoryId;
092: }
093:
094: public void setCategoryId(Integer categoryId) {
095: this .categoryId = categoryId;
096: }
097:
098: public String toString() {
099: ToStringBuilder buf = new ToStringBuilder(this );
100: buf.append("articleId", articleId).append("name", name).append(
101: "description", description).append("price", price)
102: .append("categoryId", categoryId).append("category",
103: category);
104: return buf.toString();
105: }
106: }
|