1
22
23 package com.liferay.portlet.blogs.model.impl;
24
25 import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26 import com.liferay.portal.kernel.util.DateUtil;
27 import com.liferay.portal.kernel.util.GetterUtil;
28 import com.liferay.portal.model.impl.BaseModelImpl;
29 import com.liferay.portal.util.PropsUtil;
30
31 import com.liferay.portlet.blogs.model.BlogsEntry;
32
33 import com.liferay.util.Html;
34
35 import java.io.Serializable;
36
37 import java.lang.reflect.Proxy;
38
39 import java.sql.Types;
40
41 import java.util.Date;
42
43
63 public class BlogsEntryModelImpl extends BaseModelImpl {
64 public static final String TABLE_NAME = "BlogsEntry";
65 public static final Object[][] TABLE_COLUMNS = {
66 { "uuid_", new Integer(Types.VARCHAR) },
67
68
69 { "entryId", new Integer(Types.BIGINT) },
70
71
72 { "groupId", new Integer(Types.BIGINT) },
73
74
75 { "companyId", new Integer(Types.BIGINT) },
76
77
78 { "userId", new Integer(Types.BIGINT) },
79
80
81 { "userName", new Integer(Types.VARCHAR) },
82
83
84 { "createDate", new Integer(Types.TIMESTAMP) },
85
86
87 { "modifiedDate", new Integer(Types.TIMESTAMP) },
88
89
90 { "title", new Integer(Types.VARCHAR) },
91
92
93 { "urlTitle", new Integer(Types.VARCHAR) },
94
95
96 { "content", new Integer(Types.CLOB) },
97
98
99 { "displayDate", new Integer(Types.TIMESTAMP) }
100 };
101 public static final String TABLE_SQL_CREATE = "create table BlogsEntry (uuid_ VARCHAR(75) null,entryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,title VARCHAR(150) null,urlTitle VARCHAR(150) null,content TEXT null,displayDate DATE null)";
102 public static final String TABLE_SQL_DROP = "drop table BlogsEntry";
103 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(PropsUtil.get(
104 "value.object.finder.cache.enabled.com.liferay.portlet.blogs.model.BlogsEntry"),
105 true);
106 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
107 "lock.expiration.time.com.liferay.portlet.blogs.model.BlogsEntry"));
108
109 public BlogsEntryModelImpl() {
110 }
111
112 public long getPrimaryKey() {
113 return _entryId;
114 }
115
116 public void setPrimaryKey(long pk) {
117 setEntryId(pk);
118 }
119
120 public Serializable getPrimaryKeyObj() {
121 return new Long(_entryId);
122 }
123
124 public String getUuid() {
125 return GetterUtil.getString(_uuid);
126 }
127
128 public void setUuid(String uuid) {
129 if ((uuid != null) && (uuid != _uuid)) {
130 _uuid = uuid;
131 }
132 }
133
134 public long getEntryId() {
135 return _entryId;
136 }
137
138 public void setEntryId(long entryId) {
139 if (entryId != _entryId) {
140 _entryId = entryId;
141 }
142 }
143
144 public long getGroupId() {
145 return _groupId;
146 }
147
148 public void setGroupId(long groupId) {
149 if (groupId != _groupId) {
150 _groupId = groupId;
151 }
152 }
153
154 public long getCompanyId() {
155 return _companyId;
156 }
157
158 public void setCompanyId(long companyId) {
159 if (companyId != _companyId) {
160 _companyId = companyId;
161 }
162 }
163
164 public long getUserId() {
165 return _userId;
166 }
167
168 public void setUserId(long userId) {
169 if (userId != _userId) {
170 _userId = userId;
171 }
172 }
173
174 public String getUserName() {
175 return GetterUtil.getString(_userName);
176 }
177
178 public void setUserName(String userName) {
179 if (((userName == null) && (_userName != null)) ||
180 ((userName != null) && (_userName == null)) ||
181 ((userName != null) && (_userName != null) &&
182 !userName.equals(_userName))) {
183 _userName = userName;
184 }
185 }
186
187 public Date getCreateDate() {
188 return _createDate;
189 }
190
191 public void setCreateDate(Date createDate) {
192 if (((createDate == null) && (_createDate != null)) ||
193 ((createDate != null) && (_createDate == null)) ||
194 ((createDate != null) && (_createDate != null) &&
195 !createDate.equals(_createDate))) {
196 _createDate = createDate;
197 }
198 }
199
200 public Date getModifiedDate() {
201 return _modifiedDate;
202 }
203
204 public void setModifiedDate(Date modifiedDate) {
205 if (((modifiedDate == null) && (_modifiedDate != null)) ||
206 ((modifiedDate != null) && (_modifiedDate == null)) ||
207 ((modifiedDate != null) && (_modifiedDate != null) &&
208 !modifiedDate.equals(_modifiedDate))) {
209 _modifiedDate = modifiedDate;
210 }
211 }
212
213 public String getTitle() {
214 return GetterUtil.getString(_title);
215 }
216
217 public void setTitle(String title) {
218 if (((title == null) && (_title != null)) ||
219 ((title != null) && (_title == null)) ||
220 ((title != null) && (_title != null) && !title.equals(_title))) {
221 _title = title;
222 }
223 }
224
225 public String getUrlTitle() {
226 return GetterUtil.getString(_urlTitle);
227 }
228
229 public void setUrlTitle(String urlTitle) {
230 if (((urlTitle == null) && (_urlTitle != null)) ||
231 ((urlTitle != null) && (_urlTitle == null)) ||
232 ((urlTitle != null) && (_urlTitle != null) &&
233 !urlTitle.equals(_urlTitle))) {
234 _urlTitle = urlTitle;
235 }
236 }
237
238 public String getContent() {
239 return GetterUtil.getString(_content);
240 }
241
242 public void setContent(String content) {
243 if (((content == null) && (_content != null)) ||
244 ((content != null) && (_content == null)) ||
245 ((content != null) && (_content != null) &&
246 !content.equals(_content))) {
247 _content = content;
248 }
249 }
250
251 public Date getDisplayDate() {
252 return _displayDate;
253 }
254
255 public void setDisplayDate(Date displayDate) {
256 if (((displayDate == null) && (_displayDate != null)) ||
257 ((displayDate != null) && (_displayDate == null)) ||
258 ((displayDate != null) && (_displayDate != null) &&
259 !displayDate.equals(_displayDate))) {
260 _displayDate = displayDate;
261 }
262 }
263
264 public BlogsEntry toEscapedModel() {
265 if (isEscapedModel()) {
266 return (BlogsEntry)this;
267 }
268 else {
269 BlogsEntry model = new BlogsEntryImpl();
270
271 model.setEscapedModel(true);
272
273 model.setUuid(Html.escape(getUuid()));
274 model.setEntryId(getEntryId());
275 model.setGroupId(getGroupId());
276 model.setCompanyId(getCompanyId());
277 model.setUserId(getUserId());
278 model.setUserName(Html.escape(getUserName()));
279 model.setCreateDate(getCreateDate());
280 model.setModifiedDate(getModifiedDate());
281 model.setTitle(Html.escape(getTitle()));
282 model.setUrlTitle(Html.escape(getUrlTitle()));
283 model.setContent(Html.escape(getContent()));
284 model.setDisplayDate(getDisplayDate());
285
286 model = (BlogsEntry)Proxy.newProxyInstance(BlogsEntry.class.getClassLoader(),
287 new Class[] { BlogsEntry.class },
288 new ReadOnlyBeanHandler(model));
289
290 return model;
291 }
292 }
293
294 public Object clone() {
295 BlogsEntryImpl clone = new BlogsEntryImpl();
296
297 clone.setUuid(getUuid());
298 clone.setEntryId(getEntryId());
299 clone.setGroupId(getGroupId());
300 clone.setCompanyId(getCompanyId());
301 clone.setUserId(getUserId());
302 clone.setUserName(getUserName());
303 clone.setCreateDate(getCreateDate());
304 clone.setModifiedDate(getModifiedDate());
305 clone.setTitle(getTitle());
306 clone.setUrlTitle(getUrlTitle());
307 clone.setContent(getContent());
308 clone.setDisplayDate(getDisplayDate());
309
310 return clone;
311 }
312
313 public int compareTo(Object obj) {
314 if (obj == null) {
315 return -1;
316 }
317
318 BlogsEntryImpl blogsEntry = (BlogsEntryImpl)obj;
319
320 int value = 0;
321
322 value = DateUtil.compareTo(getDisplayDate(), blogsEntry.getDisplayDate());
323
324 value = value * -1;
325
326 if (value != 0) {
327 return value;
328 }
329
330 return 0;
331 }
332
333 public boolean equals(Object obj) {
334 if (obj == null) {
335 return false;
336 }
337
338 BlogsEntryImpl blogsEntry = null;
339
340 try {
341 blogsEntry = (BlogsEntryImpl)obj;
342 }
343 catch (ClassCastException cce) {
344 return false;
345 }
346
347 long pk = blogsEntry.getPrimaryKey();
348
349 if (getPrimaryKey() == pk) {
350 return true;
351 }
352 else {
353 return false;
354 }
355 }
356
357 public int hashCode() {
358 return (int)getPrimaryKey();
359 }
360
361 private String _uuid;
362 private long _entryId;
363 private long _groupId;
364 private long _companyId;
365 private long _userId;
366 private String _userName;
367 private Date _createDate;
368 private Date _modifiedDate;
369 private String _title;
370 private String _urlTitle;
371 private String _content;
372 private Date _displayDate;
373 }