/home/mario/oci/jnb/dataaccess/source/src/gen/com/ociweb/bean/Product.java

1    /** 
2     * This software program, Simple Data Access Layer (SDAL), is copyrighted by Object 
3     * Computing inc of St. Louis MO USA. It is provided under the open-source model 
4     * and is free of license fees. You are free to modify this code for your own use 
5     * but you may not claim copyright. 
6     * 
7     * Since SDAL is open source and free of licensing fees, you are free to use, 
8     * modify, and distribute the source code, as long as you include this copyright 
9     * statement. 
10    * 
11    * In particular, you can use SDAL to build proprietary software and are under no 
12    * obligation to redistribute any of your source code that is built using SDAL. 
13    * Note, however, that you may not do anything to the SDAL code, such as 
14    * copyrighting it yourself or claiming authorship of the SDAL code, that will 
15    * prevent SDAL from being distributed freely using an open source development 
16    * model. 
17    * 
18    * Warranty 
19    * LICENSED PRODUCT, SDAL, IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 
20    * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE, 
21    * NONINFRINGEMENT, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 
22    * 
23    * Support 
24    * LICENSED PRODUCT, SDAL, IS PROVIDED WITH NO SUPPORT AND WITHOUT ANY OBLIGATION ON THE 
25    * PART OF OCI OR ANY OF ITS SUBSIDIARIES OR AFFILIATES TO ASSIST IN ITS USE, 
26    * CORRECTION, MODIFICATION OR ENHANCEMENT. 
27    * 
28    * Support may be available from OCI to users who have agreed to a support 
29    * contract. 
30    * 
31    * Liability 
32    * OCI OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH 
33    * RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY 
34    * LICENSED PRODUCT OR ANY PART THEREOF. 
35    * 
36    * IN NO EVENT WILL OCI OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR ANY 
37    * LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL DAMAGES, 
38    * EVEN IF OCI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
39    * 
40    * Copyright OCI. St. Louis MO USA, 2004 
41    * 
42    */ 
43   package com.ociweb.bean; 
44    
45   import java.io.Serializable; 
46   import java.util.Set; 
47   import org.apache.commons.lang.builder.EqualsBuilder; 
48   import org.apache.commons.lang.builder.HashCodeBuilder; 
49   import org.apache.commons.lang.builder.ToStringBuilder; 
50    
51   /** @author Hibernate CodeGenerator */ 
52   public class Product implements Serializable { 
53    
54       /** identifier field */ 
55       private Long id; 
56    
57       /** persistent field */ 
58       private String name; 
59    
60       /** nullable persistent field */ 
61       private double cost; 
62    
63       /** persistent field */ 
64       private Set orderitems; 
65    
66       /** full constructor */ 
67       public Product(java.lang.String name, double cost, Set orderitems) { 
68           this.name = name; 
69           this.cost = cost; 
70           this.orderitems = orderitems; 
71       } 
72    
73       /** default constructor */ 
74       public Product() { 
75       } 
76    
77       /** minimal constructor */ 
78       public Product(java.lang.String name, Set orderitems) { 
79           this.name = name; 
80           this.orderitems = orderitems; 
81       } 
82    
83       public java.lang.Long getId() { 
84           return this.id; 
85       } 
86    
87       public void setId(java.lang.Long id) { 
88           this.id = id; 
89       } 
90    
91       public java.lang.String getName() { 
92           return this.name; 
93       } 
94    
95       public void setName(java.lang.String name) { 
96           this.name = name; 
97       } 
98    
99       public double getCost() { 
100          return this.cost; 
101      } 
102   
103      public void setCost(double cost) { 
104          this.cost = cost; 
105      } 
106   
107      public java.util.Set getOrderitems() { 
108          return this.orderitems; 
109      } 
110   
111      public void setOrderitems(java.util.Set orderitems) { 
112          this.orderitems = orderitems; 
113      } 
114   
115      public String toString() { 
116          return new ToStringBuilder(this) 
117              .append("id", getId()) 
118              .toString(); 
119      } 
120   
121      public boolean equals(Object other) { 
122          if ( !(other instanceof Product) ) return false; 
123          Product castOther = (Product) other; 
124          return new EqualsBuilder() 
125              .append(this.getId(), castOther.getId()) 
126              .isEquals(); 
127      } 
128   
129      public int hashCode() { 
130          return new HashCodeBuilder() 
131              .append(getId()) 
132              .toHashCode(); 
133      } 
134   
135  } 
136