KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.roller.pojos;
2
3
4 /**
5  * @author David M Johnson
6  *
7  * @ejb:bean name="FolderAssoc"
8  * @hibernate.class table="folderassoc"
9  * hibernate.jcs-cache usage="read-write"
10  */

11 public class FolderAssoc extends PersistentObject
12     implements Assoc
13 {
14     static final long serialVersionUID = 882325251670705915L;
15     public static final String JavaDoc PARENT = "PARENT";
16     public static final String JavaDoc GRANDPARENT = "GRANDPARENT";
17
18     protected String JavaDoc id;
19     protected FolderData folder;
20     protected FolderData ancestor;
21     protected java.lang.String JavaDoc relation;
22     
23     public FolderAssoc()
24     {
25     }
26
27     public FolderAssoc(
28         String JavaDoc id,
29         FolderData folder,
30         FolderData ancestor,
31         String JavaDoc relation)
32     {
33         this.id = id;
34         this.folder = folder;
35         this.ancestor = ancestor;
36         this.relation = relation;
37     }
38
39     public FolderAssoc(FolderAssoc otherData)
40     {
41         this.id = otherData.id;
42         this.folder = otherData.folder;
43         this.ancestor = otherData.ancestor;
44         this.relation = otherData.relation;
45     }
46
47     /**
48      * @ejb:persistent-field
49      * @hibernate.id column="id" type="string"
50      * generator-class="uuid.hex" unsaved-value="null"
51      */

52     public java.lang.String JavaDoc getId()
53     {
54         return this.id;
55     }
56     /** @ejb:persistent-field */
57     public void setId(java.lang.String JavaDoc id)
58     {
59         this.id = id;
60     }
61
62     /**
63         * Setter is needed in RollerImpl.storePersistentObject()
64      */

65     public void setData(org.roller.pojos.PersistentObject otherData)
66     {
67         this.id = otherData.getId();
68         this.folder = ((FolderAssoc)otherData).getFolder();
69         this.ancestor = ((FolderAssoc)otherData).getAncestorFolder();
70         this.relation = ((FolderAssoc)otherData).getRelation();
71     }
72
73     /**
74      * @ejb:persistent-field
75      * @hibernate.many-to-one column="ancestorid" cascade="none"
76      */

77     public FolderData getAncestorFolder()
78     {
79         return ancestor;
80     }
81     
82     /** @ejb:persistent-field */
83     public void setAncestorFolder(FolderData data)
84     {
85         ancestor = data;
86     }
87
88     /**
89      * @ejb:persistent-field
90      * @hibernate.many-to-one column="folderid" cascade="none" not-null="true"
91      */

92     public FolderData getFolder()
93     {
94         return folder;
95     }
96
97     /** @ejb:persistent-field */
98     public void setFolder(FolderData data)
99     {
100         folder = data;
101     }
102
103     /**
104      * @ejb:persistent-field
105      * @hibernate.property column="relation" non-null="true" unique="false"
106      */

107     public java.lang.String JavaDoc getRelation()
108     {
109         return relation;
110     }
111
112     /** @ejb:persistent-field */
113     public void setRelation(java.lang.String JavaDoc string)
114     {
115         relation = string;
116     }
117
118     public HierarchicalPersistentObject getObject()
119     {
120         return getFolder();
121     }
122
123     public void setObject(HierarchicalPersistentObject hpo)
124     {
125         setFolder((FolderData)hpo);
126     }
127
128     public HierarchicalPersistentObject getAncestor()
129     {
130         return getAncestorFolder();
131     }
132
133     public void setAncestor(HierarchicalPersistentObject hpo)
134     {
135         setAncestorFolder((FolderData)hpo);
136     }
137
138 }
139
Popular Tags