KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > pojos > RollerPropertyData


1 /*
2  * RollerConfigProperty.java
3  *
4  * Created on April 20, 2005, 2:58 PM
5  */

6
7 package org.roller.pojos;
8
9
10 /**
11  * This POJO represents a single property of the roller system.
12  *
13  * @author Allen Gilliland
14  *
15  * @ejb:bean name="RollerPropertyData"
16  * @hibernate.class table="roller_properties"
17  * hibernate.jcs-cache usage="read-write"
18  */

19 public class RollerPropertyData
20     extends org.roller.pojos.PersistentObject
21     implements java.io.Serializable JavaDoc
22 {
23     
24     static final long serialVersionUID = 6913562779484028899L;
25     
26     
27     /**
28      * Holds value of property name.
29      */

30     private String JavaDoc name;
31
32     /**
33      * Holds value of property value.
34      */

35     private String JavaDoc value;
36
37     
38     public RollerPropertyData() {}
39     
40     
41     public RollerPropertyData(String JavaDoc name, String JavaDoc value) {
42         this.name = name;
43         this.value = value;
44     }
45     
46     
47     public void setData(PersistentObject object)
48     {
49     if (object instanceof RollerPropertyData)
50         {
51             RollerPropertyData prop = (RollerPropertyData) object;
52             this.name = prop.name;
53             this.value = prop.value;
54         }
55     }
56     
57     
58     public String JavaDoc toString()
59     {
60         return (this.name + "=" + this.value);
61     }
62     
63
64     /**
65      * Getter for property name.
66      *
67      * @return Value of property name.
68      * @ejb:persistent-field
69      * @hibernate.id column="name" type="string" generator-class="assigned"
70      */

71     public String JavaDoc getName() {
72
73         return this.name;
74     }
75
76     /**
77      * Setter for property name.
78      *
79      * @param name New value of property name.
80      * @ejb:persistent-field
81      */

82     public void setName(String JavaDoc name) {
83
84         this.name = name;
85     }
86
87     /**
88      * Getter for property value.
89      *
90      * @return Value of property value.
91      * @ejb:persistent-field
92      * @hibernate.property column="value" non-null="false" unique="false"
93      */

94     public String JavaDoc getValue() {
95
96         return this.value;
97     }
98
99     /**
100      * Setter for property value.
101      *
102      * @param value New value of property value.
103      * @ejb:persistent-field
104      */

105     public void setValue(String JavaDoc value) {
106
107         this.value = value;
108     }
109     
110     
111     public String JavaDoc getId() {
112         // this is only here because it is required by PersistentObject
113
return null;
114     }
115     
116     
117     public void setId(String JavaDoc id) {
118         // do nothing ... only here because the PersistentObject class requires it
119
}
120 }
121
Popular Tags