KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.roller.pojos;
2 /**
3  * @author David M Johnson
4  * @ejb:bean name="EntryAttribute"
5  * @hibernate.class table="entryattribute"
6  */

7 public class EntryAttributeData extends PersistentObject implements java.lang.Comparable JavaDoc
8 {
9     protected String JavaDoc id;
10     protected WeblogEntryData entry;
11     protected String JavaDoc name;
12     protected String JavaDoc value;
13     
14     public EntryAttributeData()
15     {
16     }
17
18     public EntryAttributeData(
19         String JavaDoc id,
20         WeblogEntryData entry,
21         String JavaDoc name,
22         String JavaDoc value)
23     {
24         this.id = id;
25         this.entry = entry;
26         this.name = name;
27         this.value = value;
28     }
29
30     public EntryAttributeData(EntryAttributeData otherData)
31     {
32         this.id = otherData.id;
33         this.entry = otherData.entry;
34         this.name = otherData.name;
35         this.value = otherData.value;
36     }
37
38     /**
39      * @ejb:persistent-field
40      * @hibernate.id column="id" type="string"
41      * generator-class="uuid.hex" unsaved-value="null"
42      */

43     public java.lang.String JavaDoc getId()
44     {
45         return this.id;
46     }
47     /** @ejb:persistent-field */
48     public void setId(java.lang.String JavaDoc id)
49     {
50         this.id = id;
51     }
52
53     /**
54         * Setter is needed in RollerImpl.storePersistentObject()
55      */

56     public void setData(org.roller.pojos.PersistentObject otherData)
57     {
58         this.id = otherData.getId();
59         this.entry = ((EntryAttributeData) otherData).entry;
60         this.name = ((EntryAttributeData) otherData).name;
61         this.value = ((EntryAttributeData) otherData).value;
62     }
63
64     /**
65      * @ejb:persistent-field
66      * @hibernate.many-to-one column="entryid" cascade="none" not-null="true"
67      */

68     public WeblogEntryData getEntry()
69     {
70         return entry;
71     }
72     /** @ejb:persistent-field */
73     public void setEntry(WeblogEntryData entry)
74     {
75         this.entry = entry;
76     }
77
78     /**
79      * @ejb:persistent-field
80      * @hibernate.property column="name" non-null="true" unique="false"
81      */

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

96     public String JavaDoc getValue()
97     {
98         return value;
99     }
100     /** @ejb:persistent-field */
101     public void setValue(String JavaDoc value)
102     {
103         this.value = value;
104     }
105
106     public int compareTo(Object JavaDoc o) {
107         EntryAttributeData att = (EntryAttributeData)o;
108         return getName().compareTo(att.getName());
109     }
110 }
111
Popular Tags