1
14
15 package com.liferay.portlet.asset.model.impl;
16
17 import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
18 import com.liferay.portal.kernel.exception.SystemException;
19 import com.liferay.portal.kernel.util.GetterUtil;
20 import com.liferay.portal.kernel.util.StringBundler;
21 import com.liferay.portal.kernel.util.StringPool;
22 import com.liferay.portal.model.impl.BaseModelImpl;
23 import com.liferay.portal.service.ServiceContext;
24 import com.liferay.portal.util.PortalUtil;
25
26 import com.liferay.portlet.asset.model.AssetEntry;
27 import com.liferay.portlet.asset.model.AssetEntrySoap;
28 import com.liferay.portlet.expando.model.ExpandoBridge;
29 import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
30
31 import java.io.Serializable;
32
33 import java.lang.reflect.Proxy;
34
35 import java.sql.Types;
36
37 import java.util.ArrayList;
38 import java.util.Date;
39 import java.util.List;
40
41
60 public class AssetEntryModelImpl extends BaseModelImpl<AssetEntry> {
61 public static final String TABLE_NAME = "AssetEntry";
62 public static final Object[][] TABLE_COLUMNS = {
63 { "entryId", new Integer(Types.BIGINT) },
64 { "groupId", new Integer(Types.BIGINT) },
65 { "companyId", new Integer(Types.BIGINT) },
66 { "userId", new Integer(Types.BIGINT) },
67 { "userName", new Integer(Types.VARCHAR) },
68 { "createDate", new Integer(Types.TIMESTAMP) },
69 { "modifiedDate", new Integer(Types.TIMESTAMP) },
70 { "classNameId", new Integer(Types.BIGINT) },
71 { "classPK", new Integer(Types.BIGINT) },
72 { "visible", new Integer(Types.BOOLEAN) },
73 { "startDate", new Integer(Types.TIMESTAMP) },
74 { "endDate", new Integer(Types.TIMESTAMP) },
75 { "publishDate", new Integer(Types.TIMESTAMP) },
76 { "expirationDate", new Integer(Types.TIMESTAMP) },
77 { "mimeType", new Integer(Types.VARCHAR) },
78 { "title", new Integer(Types.VARCHAR) },
79 { "description", new Integer(Types.VARCHAR) },
80 { "summary", new Integer(Types.VARCHAR) },
81 { "url", new Integer(Types.VARCHAR) },
82 { "height", new Integer(Types.INTEGER) },
83 { "width", new Integer(Types.INTEGER) },
84 { "priority", new Integer(Types.DOUBLE) },
85 { "viewCount", new Integer(Types.INTEGER) },
86 { "socialInformationEquity", new Integer(Types.DOUBLE) }
87 };
88 public static final String TABLE_SQL_CREATE = "create table AssetEntry (entryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,classNameId LONG,classPK LONG,visible BOOLEAN,startDate DATE null,endDate DATE null,publishDate DATE null,expirationDate DATE null,mimeType VARCHAR(75) null,title VARCHAR(255) null,description STRING null,summary STRING null,url STRING null,height INTEGER,width INTEGER,priority DOUBLE,viewCount INTEGER,socialInformationEquity DOUBLE)";
89 public static final String TABLE_SQL_DROP = "drop table AssetEntry";
90 public static final String DATA_SOURCE = "liferayDataSource";
91 public static final String SESSION_FACTORY = "liferaySessionFactory";
92 public static final String TX_MANAGER = "liferayTransactionManager";
93 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
94 "value.object.entity.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
95 true);
96 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
97 "value.object.finder.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
98 true);
99
100 public static AssetEntry toModel(AssetEntrySoap soapModel) {
101 AssetEntry model = new AssetEntryImpl();
102
103 model.setEntryId(soapModel.getEntryId());
104 model.setGroupId(soapModel.getGroupId());
105 model.setCompanyId(soapModel.getCompanyId());
106 model.setUserId(soapModel.getUserId());
107 model.setUserName(soapModel.getUserName());
108 model.setCreateDate(soapModel.getCreateDate());
109 model.setModifiedDate(soapModel.getModifiedDate());
110 model.setClassNameId(soapModel.getClassNameId());
111 model.setClassPK(soapModel.getClassPK());
112 model.setVisible(soapModel.getVisible());
113 model.setStartDate(soapModel.getStartDate());
114 model.setEndDate(soapModel.getEndDate());
115 model.setPublishDate(soapModel.getPublishDate());
116 model.setExpirationDate(soapModel.getExpirationDate());
117 model.setMimeType(soapModel.getMimeType());
118 model.setTitle(soapModel.getTitle());
119 model.setDescription(soapModel.getDescription());
120 model.setSummary(soapModel.getSummary());
121 model.setUrl(soapModel.getUrl());
122 model.setHeight(soapModel.getHeight());
123 model.setWidth(soapModel.getWidth());
124 model.setPriority(soapModel.getPriority());
125 model.setViewCount(soapModel.getViewCount());
126 model.setSocialInformationEquity(soapModel.getSocialInformationEquity());
127
128 return model;
129 }
130
131 public static List<AssetEntry> toModels(AssetEntrySoap[] soapModels) {
132 List<AssetEntry> models = new ArrayList<AssetEntry>(soapModels.length);
133
134 for (AssetEntrySoap soapModel : soapModels) {
135 models.add(toModel(soapModel));
136 }
137
138 return models;
139 }
140
141 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_NAME = "AssetEntries_AssetCategories";
142 public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_COLUMNS =
143 {
144 { "entryId", new Integer(Types.BIGINT) },
145 { "categoryId", new Integer(Types.BIGINT) }
146 };
147 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_SQL_CREATE =
148 "create table AssetEntries_AssetCategories (entryId LONG not null,categoryId LONG not null,primary key (entryId, categoryId))";
149 public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETCATEGORIES =
150 GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
151 "value.object.finder.cache.enabled.AssetEntries_AssetCategories"),
152 true);
153 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_NAME = "AssetEntries_AssetTags";
154 public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_COLUMNS = {
155 { "entryId", new Integer(Types.BIGINT) },
156 { "tagId", new Integer(Types.BIGINT) }
157 };
158 public static final String MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_SQL_CREATE = "create table AssetEntries_AssetTags (entryId LONG not null,tagId LONG not null,primary key (entryId, tagId))";
159 public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETTAGS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
160 "value.object.finder.cache.enabled.AssetEntries_AssetTags"),
161 true);
162 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
163 "lock.expiration.time.com.liferay.portlet.asset.model.AssetEntry"));
164
165 public AssetEntryModelImpl() {
166 }
167
168 public long getPrimaryKey() {
169 return _entryId;
170 }
171
172 public void setPrimaryKey(long pk) {
173 setEntryId(pk);
174 }
175
176 public Serializable getPrimaryKeyObj() {
177 return new Long(_entryId);
178 }
179
180 public long getEntryId() {
181 return _entryId;
182 }
183
184 public void setEntryId(long entryId) {
185 _entryId = entryId;
186 }
187
188 public long getGroupId() {
189 return _groupId;
190 }
191
192 public void setGroupId(long groupId) {
193 _groupId = groupId;
194 }
195
196 public long getCompanyId() {
197 return _companyId;
198 }
199
200 public void setCompanyId(long companyId) {
201 _companyId = companyId;
202 }
203
204 public long getUserId() {
205 return _userId;
206 }
207
208 public void setUserId(long userId) {
209 _userId = userId;
210 }
211
212 public String getUserUuid() throws SystemException {
213 return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
214 }
215
216 public void setUserUuid(String userUuid) {
217 _userUuid = userUuid;
218 }
219
220 public String getUserName() {
221 if (_userName == null) {
222 return StringPool.BLANK;
223 }
224 else {
225 return _userName;
226 }
227 }
228
229 public void setUserName(String userName) {
230 _userName = userName;
231 }
232
233 public Date getCreateDate() {
234 return _createDate;
235 }
236
237 public void setCreateDate(Date createDate) {
238 _createDate = createDate;
239 }
240
241 public Date getModifiedDate() {
242 return _modifiedDate;
243 }
244
245 public void setModifiedDate(Date modifiedDate) {
246 _modifiedDate = modifiedDate;
247 }
248
249 public String getClassName() {
250 if (getClassNameId() <= 0) {
251 return StringPool.BLANK;
252 }
253
254 return PortalUtil.getClassName(getClassNameId());
255 }
256
257 public long getClassNameId() {
258 return _classNameId;
259 }
260
261 public void setClassNameId(long classNameId) {
262 _classNameId = classNameId;
263
264 if (!_setOriginalClassNameId) {
265 _setOriginalClassNameId = true;
266
267 _originalClassNameId = classNameId;
268 }
269 }
270
271 public long getOriginalClassNameId() {
272 return _originalClassNameId;
273 }
274
275 public long getClassPK() {
276 return _classPK;
277 }
278
279 public void setClassPK(long classPK) {
280 _classPK = classPK;
281
282 if (!_setOriginalClassPK) {
283 _setOriginalClassPK = true;
284
285 _originalClassPK = classPK;
286 }
287 }
288
289 public long getOriginalClassPK() {
290 return _originalClassPK;
291 }
292
293 public boolean getVisible() {
294 return _visible;
295 }
296
297 public boolean isVisible() {
298 return _visible;
299 }
300
301 public void setVisible(boolean visible) {
302 _visible = visible;
303 }
304
305 public Date getStartDate() {
306 return _startDate;
307 }
308
309 public void setStartDate(Date startDate) {
310 _startDate = startDate;
311 }
312
313 public Date getEndDate() {
314 return _endDate;
315 }
316
317 public void setEndDate(Date endDate) {
318 _endDate = endDate;
319 }
320
321 public Date getPublishDate() {
322 return _publishDate;
323 }
324
325 public void setPublishDate(Date publishDate) {
326 _publishDate = publishDate;
327 }
328
329 public Date getExpirationDate() {
330 return _expirationDate;
331 }
332
333 public void setExpirationDate(Date expirationDate) {
334 _expirationDate = expirationDate;
335 }
336
337 public String getMimeType() {
338 if (_mimeType == null) {
339 return StringPool.BLANK;
340 }
341 else {
342 return _mimeType;
343 }
344 }
345
346 public void setMimeType(String mimeType) {
347 _mimeType = mimeType;
348 }
349
350 public String getTitle() {
351 if (_title == null) {
352 return StringPool.BLANK;
353 }
354 else {
355 return _title;
356 }
357 }
358
359 public void setTitle(String title) {
360 _title = title;
361 }
362
363 public String getDescription() {
364 if (_description == null) {
365 return StringPool.BLANK;
366 }
367 else {
368 return _description;
369 }
370 }
371
372 public void setDescription(String description) {
373 _description = description;
374 }
375
376 public String getSummary() {
377 if (_summary == null) {
378 return StringPool.BLANK;
379 }
380 else {
381 return _summary;
382 }
383 }
384
385 public void setSummary(String summary) {
386 _summary = summary;
387 }
388
389 public String getUrl() {
390 if (_url == null) {
391 return StringPool.BLANK;
392 }
393 else {
394 return _url;
395 }
396 }
397
398 public void setUrl(String url) {
399 _url = url;
400 }
401
402 public int getHeight() {
403 return _height;
404 }
405
406 public void setHeight(int height) {
407 _height = height;
408 }
409
410 public int getWidth() {
411 return _width;
412 }
413
414 public void setWidth(int width) {
415 _width = width;
416 }
417
418 public double getPriority() {
419 return _priority;
420 }
421
422 public void setPriority(double priority) {
423 _priority = priority;
424 }
425
426 public int getViewCount() {
427 return _viewCount;
428 }
429
430 public void setViewCount(int viewCount) {
431 _viewCount = viewCount;
432 }
433
434 public double getSocialInformationEquity() {
435 return _socialInformationEquity;
436 }
437
438 public void setSocialInformationEquity(double socialInformationEquity) {
439 _socialInformationEquity = socialInformationEquity;
440 }
441
442 public AssetEntry toEscapedModel() {
443 if (isEscapedModel()) {
444 return (AssetEntry)this;
445 }
446 else {
447 return (AssetEntry)Proxy.newProxyInstance(AssetEntry.class.getClassLoader(),
448 new Class[] { AssetEntry.class },
449 new AutoEscapeBeanHandler(this));
450 }
451 }
452
453 public ExpandoBridge getExpandoBridge() {
454 if (_expandoBridge == null) {
455 _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
456 AssetEntry.class.getName(), getPrimaryKey());
457 }
458
459 return _expandoBridge;
460 }
461
462 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
463 getExpandoBridge().setAttributes(serviceContext);
464 }
465
466 public Object clone() {
467 AssetEntryImpl clone = new AssetEntryImpl();
468
469 clone.setEntryId(getEntryId());
470 clone.setGroupId(getGroupId());
471 clone.setCompanyId(getCompanyId());
472 clone.setUserId(getUserId());
473 clone.setUserName(getUserName());
474 clone.setCreateDate(getCreateDate());
475 clone.setModifiedDate(getModifiedDate());
476 clone.setClassNameId(getClassNameId());
477 clone.setClassPK(getClassPK());
478 clone.setVisible(getVisible());
479 clone.setStartDate(getStartDate());
480 clone.setEndDate(getEndDate());
481 clone.setPublishDate(getPublishDate());
482 clone.setExpirationDate(getExpirationDate());
483 clone.setMimeType(getMimeType());
484 clone.setTitle(getTitle());
485 clone.setDescription(getDescription());
486 clone.setSummary(getSummary());
487 clone.setUrl(getUrl());
488 clone.setHeight(getHeight());
489 clone.setWidth(getWidth());
490 clone.setPriority(getPriority());
491 clone.setViewCount(getViewCount());
492 clone.setSocialInformationEquity(getSocialInformationEquity());
493
494 return clone;
495 }
496
497 public int compareTo(AssetEntry assetEntry) {
498 long pk = assetEntry.getPrimaryKey();
499
500 if (getPrimaryKey() < pk) {
501 return -1;
502 }
503 else if (getPrimaryKey() > pk) {
504 return 1;
505 }
506 else {
507 return 0;
508 }
509 }
510
511 public boolean equals(Object obj) {
512 if (obj == null) {
513 return false;
514 }
515
516 AssetEntry assetEntry = null;
517
518 try {
519 assetEntry = (AssetEntry)obj;
520 }
521 catch (ClassCastException cce) {
522 return false;
523 }
524
525 long pk = assetEntry.getPrimaryKey();
526
527 if (getPrimaryKey() == pk) {
528 return true;
529 }
530 else {
531 return false;
532 }
533 }
534
535 public int hashCode() {
536 return (int)getPrimaryKey();
537 }
538
539 public String toString() {
540 StringBundler sb = new StringBundler(49);
541
542 sb.append("{entryId=");
543 sb.append(getEntryId());
544 sb.append(", groupId=");
545 sb.append(getGroupId());
546 sb.append(", companyId=");
547 sb.append(getCompanyId());
548 sb.append(", userId=");
549 sb.append(getUserId());
550 sb.append(", userName=");
551 sb.append(getUserName());
552 sb.append(", createDate=");
553 sb.append(getCreateDate());
554 sb.append(", modifiedDate=");
555 sb.append(getModifiedDate());
556 sb.append(", classNameId=");
557 sb.append(getClassNameId());
558 sb.append(", classPK=");
559 sb.append(getClassPK());
560 sb.append(", visible=");
561 sb.append(getVisible());
562 sb.append(", startDate=");
563 sb.append(getStartDate());
564 sb.append(", endDate=");
565 sb.append(getEndDate());
566 sb.append(", publishDate=");
567 sb.append(getPublishDate());
568 sb.append(", expirationDate=");
569 sb.append(getExpirationDate());
570 sb.append(", mimeType=");
571 sb.append(getMimeType());
572 sb.append(", title=");
573 sb.append(getTitle());
574 sb.append(", description=");
575 sb.append(getDescription());
576 sb.append(", summary=");
577 sb.append(getSummary());
578 sb.append(", url=");
579 sb.append(getUrl());
580 sb.append(", height=");
581 sb.append(getHeight());
582 sb.append(", width=");
583 sb.append(getWidth());
584 sb.append(", priority=");
585 sb.append(getPriority());
586 sb.append(", viewCount=");
587 sb.append(getViewCount());
588 sb.append(", socialInformationEquity=");
589 sb.append(getSocialInformationEquity());
590 sb.append("}");
591
592 return sb.toString();
593 }
594
595 public String toXmlString() {
596 StringBundler sb = new StringBundler(76);
597
598 sb.append("<model><model-name>");
599 sb.append("com.liferay.portlet.asset.model.AssetEntry");
600 sb.append("</model-name>");
601
602 sb.append(
603 "<column><column-name>entryId</column-name><column-value><![CDATA[");
604 sb.append(getEntryId());
605 sb.append("]]></column-value></column>");
606 sb.append(
607 "<column><column-name>groupId</column-name><column-value><![CDATA[");
608 sb.append(getGroupId());
609 sb.append("]]></column-value></column>");
610 sb.append(
611 "<column><column-name>companyId</column-name><column-value><![CDATA[");
612 sb.append(getCompanyId());
613 sb.append("]]></column-value></column>");
614 sb.append(
615 "<column><column-name>userId</column-name><column-value><![CDATA[");
616 sb.append(getUserId());
617 sb.append("]]></column-value></column>");
618 sb.append(
619 "<column><column-name>userName</column-name><column-value><![CDATA[");
620 sb.append(getUserName());
621 sb.append("]]></column-value></column>");
622 sb.append(
623 "<column><column-name>createDate</column-name><column-value><![CDATA[");
624 sb.append(getCreateDate());
625 sb.append("]]></column-value></column>");
626 sb.append(
627 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
628 sb.append(getModifiedDate());
629 sb.append("]]></column-value></column>");
630 sb.append(
631 "<column><column-name>classNameId</column-name><column-value><![CDATA[");
632 sb.append(getClassNameId());
633 sb.append("]]></column-value></column>");
634 sb.append(
635 "<column><column-name>classPK</column-name><column-value><![CDATA[");
636 sb.append(getClassPK());
637 sb.append("]]></column-value></column>");
638 sb.append(
639 "<column><column-name>visible</column-name><column-value><![CDATA[");
640 sb.append(getVisible());
641 sb.append("]]></column-value></column>");
642 sb.append(
643 "<column><column-name>startDate</column-name><column-value><![CDATA[");
644 sb.append(getStartDate());
645 sb.append("]]></column-value></column>");
646 sb.append(
647 "<column><column-name>endDate</column-name><column-value><![CDATA[");
648 sb.append(getEndDate());
649 sb.append("]]></column-value></column>");
650 sb.append(
651 "<column><column-name>publishDate</column-name><column-value><![CDATA[");
652 sb.append(getPublishDate());
653 sb.append("]]></column-value></column>");
654 sb.append(
655 "<column><column-name>expirationDate</column-name><column-value><![CDATA[");
656 sb.append(getExpirationDate());
657 sb.append("]]></column-value></column>");
658 sb.append(
659 "<column><column-name>mimeType</column-name><column-value><![CDATA[");
660 sb.append(getMimeType());
661 sb.append("]]></column-value></column>");
662 sb.append(
663 "<column><column-name>title</column-name><column-value><![CDATA[");
664 sb.append(getTitle());
665 sb.append("]]></column-value></column>");
666 sb.append(
667 "<column><column-name>description</column-name><column-value><![CDATA[");
668 sb.append(getDescription());
669 sb.append("]]></column-value></column>");
670 sb.append(
671 "<column><column-name>summary</column-name><column-value><![CDATA[");
672 sb.append(getSummary());
673 sb.append("]]></column-value></column>");
674 sb.append(
675 "<column><column-name>url</column-name><column-value><![CDATA[");
676 sb.append(getUrl());
677 sb.append("]]></column-value></column>");
678 sb.append(
679 "<column><column-name>height</column-name><column-value><![CDATA[");
680 sb.append(getHeight());
681 sb.append("]]></column-value></column>");
682 sb.append(
683 "<column><column-name>width</column-name><column-value><![CDATA[");
684 sb.append(getWidth());
685 sb.append("]]></column-value></column>");
686 sb.append(
687 "<column><column-name>priority</column-name><column-value><![CDATA[");
688 sb.append(getPriority());
689 sb.append("]]></column-value></column>");
690 sb.append(
691 "<column><column-name>viewCount</column-name><column-value><![CDATA[");
692 sb.append(getViewCount());
693 sb.append("]]></column-value></column>");
694 sb.append(
695 "<column><column-name>socialInformationEquity</column-name><column-value><![CDATA[");
696 sb.append(getSocialInformationEquity());
697 sb.append("]]></column-value></column>");
698
699 sb.append("</model>");
700
701 return sb.toString();
702 }
703
704 private long _entryId;
705 private long _groupId;
706 private long _companyId;
707 private long _userId;
708 private String _userUuid;
709 private String _userName;
710 private Date _createDate;
711 private Date _modifiedDate;
712 private long _classNameId;
713 private long _originalClassNameId;
714 private boolean _setOriginalClassNameId;
715 private long _classPK;
716 private long _originalClassPK;
717 private boolean _setOriginalClassPK;
718 private boolean _visible;
719 private Date _startDate;
720 private Date _endDate;
721 private Date _publishDate;
722 private Date _expirationDate;
723 private String _mimeType;
724 private String _title;
725 private String _description;
726 private String _summary;
727 private String _url;
728 private int _height;
729 private int _width;
730 private double _priority;
731 private int _viewCount;
732 private double _socialInformationEquity;
733 private transient ExpandoBridge _expandoBridge;
734 }