01: package org.julp.examples;
02:
03: public class Product extends org.julp.AbstractDomainObject implements
04: java.io.Serializable, Cloneable {
05:
06: public Product() {
07: }
08:
09: protected java.lang.Integer productId;
10: protected java.lang.String name;
11: protected double price;
12: protected java.lang.String comments;
13:
14: public java.lang.Integer getProductId() {
15: return this .productId;
16: }
17:
18: public void setProductId(java.lang.Integer productId) {
19: if (!isLoading()) {
20: /* DBColumn nullability: NoNulls - modify as needed */
21: if (productId == null) {
22: throw new IllegalArgumentException(
23: "Missing field: productId");
24: }
25: if (!productId.equals(this .productId)) {
26: this .modified = true;
27: }
28: }
29: this .productId = productId;
30: }
31:
32: public java.lang.String getName() {
33: return this .name;
34: }
35:
36: public void setName(java.lang.String name) {
37: if (!isLoading()) {
38: /* DBColumn nullability: NoNulls - modify as needed */
39: if (name == null) {
40: throw new IllegalArgumentException(
41: "Missing field: name");
42: }
43: if (!name.equals(this .name)) {
44: this .modified = true;
45: }
46: }
47: this .name = name;
48: }
49:
50: public double getPrice() {
51: return this .price;
52: }
53:
54: public void setPrice(double price) {
55: if (!isLoading()) {
56: /* DBColumn nullability: NoNulls - modify as needed */
57: if (price <= 0.0) {
58: throw new IllegalArgumentException("Invalid Price: "
59: + price);
60: }
61: if (price != this .price) {
62: this .modified = true;
63: }
64: }
65: this .price = price;
66: }
67:
68: public java.lang.String getComments() {
69: return this .comments;
70: }
71:
72: public void setComments(java.lang.String comments) {
73: if (!isLoading()) {
74: /* DBColumn nullability: Nullable - modify as needed */
75: if (comments == null && this .comments != null) {
76: this .modified = true;
77: } else if (comments != null && this .comments == null) {
78: this .modified = true;
79: } else if (!comments.equals(this .comments)) {
80: this .modified = true;
81: }
82: }
83: this.comments = comments;
84: }
85:
86: }
|