KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright 2005 Sun Microsystems, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not 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.
15  */

16 package org.roller.pojos;
17
18 import java.io.Serializable JavaDoc;
19 import java.util.ArrayList JavaDoc;
20 import java.util.Collection JavaDoc;
21 import java.util.Date JavaDoc;
22 import java.util.List JavaDoc;
23
24
25
26 /**
27  * @struts.form include-all="true"
28  * @ejb:bean name="PlanetSubscriptionData"
29  * @hibernate.class table="rag_subscription"
30  */

31 public class PlanetSubscriptionData extends PersistentObject
32     implements Serializable JavaDoc, Comparable JavaDoc
33 {
34     /** Database ID */
35     protected String JavaDoc id;
36     
37     /** Title of the blog or website */
38     protected String JavaDoc title;
39     
40     /** Name of blog or website author */
41     protected String JavaDoc author;
42     
43     /** URL of the newsfeed */
44     protected String JavaDoc feedUrl;
45     
46     /** URL of the blog or website */
47     protected String JavaDoc siteUrl;
48     
49     /** Last update time of site */
50     protected Date JavaDoc lastUpdated;
51     
52     /** Most recent entries from site (a set of EntityData objects) */
53     protected List JavaDoc entries = new ArrayList JavaDoc();
54     
55     /** Inbound links according to Technorati */
56     protected int inboundlinks = 0;
57
58     /** Inbound blogs according to Technorati */
59     protected int inboundblogs = 0;
60     
61     protected List JavaDoc groupAssocs = new ArrayList JavaDoc();
62     
63     //----------------------------------------------------------- persistent fields
64

65     /**
66      * @hibernate.bag lazy="true" inverse="true" cascade="delete"
67      * @hibernate.collection-key column="subscription_id"
68      * @hibernate.collection-one-to-many
69      * class="org.roller.pojos.PlanetGroupSubscriptionAssoc"
70      */

71     public List JavaDoc getGroupSubscriptionAssocs()
72     {
73         return groupAssocs;
74     }
75     public void setGroupSubscriptionAssocs(List JavaDoc groupAssocs)
76     {
77         this.groupAssocs = groupAssocs;
78     }
79
80     /**
81      * @hibernate.id column="id" type="string"
82      * generator-class="uuid.hex" unsaved-value="null"
83      */

84     public String JavaDoc getId()
85     {
86         return id;
87     }
88     public void setId(String JavaDoc id)
89     {
90         this.id = id;
91     }
92     /**
93      * @hibernate.bag lazy="true" inverse="true" cascade="all"
94      * @hibernate.collection-key column="subscription_id"
95      * @hibernate.collection-one-to-many
96      * class="org.roller.pojos.PlanetEntryData"
97      */

98     public List JavaDoc getEntries()
99     {
100         return entries;
101     }
102     public void setEntries(List JavaDoc entries)
103     {
104         this.entries = entries;
105     }
106     /**
107      * @hibernate.property column="feed_url" non-null="true" unique="false"
108      */

109     public String JavaDoc getFeedUrl()
110     {
111         return feedUrl;
112     }
113     public void setFeedUrl(String JavaDoc feedUrl)
114     {
115         this.feedUrl = feedUrl;
116     }
117     /**
118      * @hibernate.property column="last_updated" non-null="false" unique="false"
119      */

120     public Date JavaDoc getLastUpdated()
121     {
122         return lastUpdated;
123     }
124     public void setLastUpdated(Date JavaDoc lastUpdated)
125     {
126         this.lastUpdated = lastUpdated;
127     }
128     /**
129      * @hibernate.property column="site_url" non-null="false" unique="false"
130      */

131     public String JavaDoc getSiteUrl()
132     {
133         return siteUrl;
134     }
135     public void setSiteUrl(String JavaDoc siteUrl)
136     {
137         this.siteUrl = siteUrl;
138     }
139     /**
140      * @hibernate.property column="title" non-null="false" unique="false"
141      */

142     public String JavaDoc getTitle()
143     {
144         return title;
145     }
146     public void setTitle(String JavaDoc title)
147     {
148         this.title = title;
149     }
150     /**
151      * @hibernate.property column="author" non-null="false" unique="false"
152      */

153     public String JavaDoc getAuthor()
154     {
155         return author;
156     }
157     public void setAuthor(String JavaDoc author)
158     {
159         this.author = author;
160     }
161     /**
162      * @hibernate.property column="inbound_links" non-null="false" unique="false"
163      */

164     public int getInboundlinks()
165     {
166         return inboundlinks;
167     }
168     public void setInboundlinks(int inboundlinks)
169     {
170         this.inboundlinks = inboundlinks;
171     }
172     /**
173      * @hibernate.property column="inbound_blogs" non-null="false" unique="false"
174      */

175     public int getInboundblogs()
176     {
177         return inboundblogs;
178     }
179     public void setInboundblogs(int inboundblogs)
180     {
181         this.inboundblogs = inboundblogs;
182     }
183
184     //-------------------------------------------------------------- implementation
185

186     /**
187      */

188     public void setData(PersistentObject vo)
189     {
190         // TODO Auto-generated method stub
191
}
192     /**
193      */

194     public int compareTo(Object JavaDoc o)
195     {
196         PlanetSubscriptionData other = (PlanetSubscriptionData)o;
197         return getFeedUrl().compareTo(other.getFeedUrl());
198     }
199
200     public void addEntry(PlanetEntryData entry)
201     {
202         entries.add(entry);
203     }
204     
205     public void addEntries(Collection JavaDoc newEntries)
206     {
207         entries.addAll(newEntries);
208     }
209     
210     public void purgeEntries()
211     {
212         entries.clear();
213     }
214 }
215
Popular Tags