KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > pojos > EntryAttributeData


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */

18 package org.apache.roller.pojos;
19 /**
20  * @author David M Johnson
21  * @ejb:bean name="EntryAttribute"
22  * @hibernate.class lazy="false" table="entryattribute"
23  * @hibernate.cache usage="read-write"
24  */

25 public class EntryAttributeData extends PersistentObject implements java.lang.Comparable JavaDoc
26 {
27     private String JavaDoc id;
28     private WeblogEntryData entry;
29     private String JavaDoc name;
30     private String JavaDoc value;
31     
32     public EntryAttributeData()
33     {
34     }
35
36     public EntryAttributeData(
37         String JavaDoc id,
38         WeblogEntryData entry,
39         String JavaDoc name,
40         String JavaDoc value)
41     {
42         this.id = id;
43         this.entry = entry;
44         this.name = name;
45         this.value = value;
46     }
47
48     public EntryAttributeData(EntryAttributeData otherData)
49     {
50         setData(otherData);
51     }
52
53     /**
54      * @roller.wrapPojoMethod type="simple"
55      * @ejb:persistent-field
56      * @hibernate.id column="id"
57      * generator-class="uuid.hex" unsaved-value="null"
58      */

59     public java.lang.String JavaDoc getId()
60     {
61         return this.id;
62     }
63     /** @ejb:persistent-field */
64     public void setId(java.lang.String JavaDoc id)
65     {
66         this.id = id;
67     }
68
69     /**
70      * Setter is needed in RollerImpl.storePersistentObject()
71      */

72     public void setData(org.apache.roller.pojos.PersistentObject otherData)
73     {
74         this.id = otherData.getId();
75         this.entry = ((EntryAttributeData) otherData).getEntry();
76         this.name = ((EntryAttributeData) otherData).getName();
77         this.value = ((EntryAttributeData) otherData).getValue();
78     }
79
80     /**
81      * @roller.wrapPojoMethod type="pojo"
82      * @ejb:persistent-field
83      * @hibernate.many-to-one column="entryid" cascade="none" not-null="true"
84      */

85     public WeblogEntryData getEntry()
86     {
87         return entry;
88     }
89     /** @ejb:persistent-field */
90     public void setEntry(WeblogEntryData entry)
91     {
92         this.entry = entry;
93     }
94
95     /**
96      * @roller.wrapPojoMethod type="simple"
97      * @ejb:persistent-field
98      * @hibernate.property column="name" non-null="true" unique="false"
99      */

100     public String JavaDoc getName()
101     {
102         return name;
103     }
104     /** @ejb:persistent-field */
105     public void setName(String JavaDoc name)
106     {
107         this.name = name;
108     }
109     
110     /**
111      * @roller.wrapPojoMethod type="simple"
112      * @ejb:persistent-field
113      * @hibernate.property column="value" non-null="true" unique="false"
114      */

115     public String JavaDoc getValue()
116     {
117         return value;
118     }
119     /** @ejb:persistent-field */
120     public void setValue(String JavaDoc value)
121     {
122         this.value = value;
123     }
124
125     public int compareTo(Object JavaDoc o) {
126         EntryAttributeData att = (EntryAttributeData)o;
127         return getName().compareTo(att.getName());
128     }
129 }
130
Popular Tags