1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.mobility.news.entity;
17
18 import java.util.List;
19 import javax.persistence.Column;
20 import javax.persistence.Entity;
21 import javax.persistence.GeneratedValue;
22 import javax.persistence.GenerationType;
23 import javax.persistence.Id;
24 import javax.persistence.Table;
25 import javax.persistence.Transient;
26 import javax.persistence.Version;
27
28
29
30
31
32
33
34
35 @Entity
36 @Table(name="NEWS_SRC_T")
37 public class NewsSourceDBImpl implements NewsSource {
38
39 @Id
40 @GeneratedValue(strategy = GenerationType.TABLE)
41 @Column(name="ID")
42 private Long id;
43
44 @Column(name="NAME")
45 private String name;
46
47 @Column(name="URL")
48 private String url;
49
50 @Column(name="ACTIVE")
51 private boolean active;
52
53 @Column(name="ORDR")
54 private int order;
55
56
57 @Transient
58 private Long parentId;
59
60 @Transient
61 private String title;
62
63 @Transient
64 private String author;
65
66 @Transient
67 private String description;
68
69 @Transient
70 private List<NewsArticleImpl> articles;
71
72 @Transient
73 private List<NewsSourceDBImpl> children;
74
75
76
77
78 @Override
79 public Long getId() {
80 return id;
81 }
82
83
84
85
86 @Override
87 public void setId(Long id) {
88 this.id = id;
89 }
90
91
92
93
94 @Override
95 public String getUrl() {
96 return url;
97 }
98
99
100
101
102 public void setUrl(String url) {
103 this.url = url;
104 }
105
106
107
108
109 @Override
110 public boolean isActive() {
111 return active;
112 }
113
114
115
116
117 @Override
118 public void setActive(boolean active) {
119 this.active = active;
120 }
121
122
123
124
125 @Override
126 public String getName() {
127 return name;
128 }
129
130
131
132
133 public void setName(String name) {
134 this.name = name;
135 }
136
137
138
139
140 @Override
141 public int getOrder() {
142 return order;
143 }
144
145
146
147
148 @Override
149 public void setOrder(int order) {
150 this.order = order;
151 }
152
153 public Long getParentId() {
154 return parentId;
155 }
156
157 public void setParentId(Long parentId) {
158 this.parentId = parentId;
159 }
160
161
162
163
164 public String getTitle() {
165 return title;
166 }
167
168
169
170
171 public void setTitle(String title) {
172 this.title = title;
173 }
174
175
176
177
178 public String getAuthor() {
179 return author;
180 }
181
182
183
184
185 public void setAuthor(String author) {
186 this.author = author;
187 }
188
189
190
191
192 public String getDescription() {
193 return description;
194 }
195
196
197
198
199 public void setDescription(String description) {
200 this.description = description;
201 }
202
203
204
205
206 public List<? extends NewsArticle> getArticles() {
207 return articles;
208 }
209
210
211
212
213 public void setArticles(List<? extends NewsArticle> articles) {
214 this.articles = (List<NewsArticleImpl>)(List<?>)articles;
215 }
216
217
218
219
220 public List<? extends NewsSource> getChildren() {
221 return children;
222 }
223
224
225
226
227 public void setChildren(List<? extends NewsSource> children) {
228 this.children = (List<NewsSourceDBImpl>)(List<?>)children;
229 }
230
231 public void addChild( NewsSource child ) {
232 this.children.add( (NewsSourceDBImpl)child);
233 }
234 }