001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.asset.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSON;
020    import com.liferay.portal.kernel.language.LanguageUtil;
021    import com.liferay.portal.kernel.util.GetterUtil;
022    import com.liferay.portal.kernel.util.LocaleUtil;
023    import com.liferay.portal.kernel.util.LocalizationUtil;
024    import com.liferay.portal.kernel.util.ProxyUtil;
025    import com.liferay.portal.kernel.util.StringBundler;
026    import com.liferay.portal.kernel.util.StringPool;
027    import com.liferay.portal.kernel.util.Validator;
028    import com.liferay.portal.model.CacheModel;
029    import com.liferay.portal.model.impl.BaseModelImpl;
030    import com.liferay.portal.service.ServiceContext;
031    import com.liferay.portal.util.PortalUtil;
032    
033    import com.liferay.portlet.asset.model.AssetEntry;
034    import com.liferay.portlet.asset.model.AssetEntryModel;
035    import com.liferay.portlet.asset.model.AssetEntrySoap;
036    import com.liferay.portlet.expando.model.ExpandoBridge;
037    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
038    
039    import java.io.Serializable;
040    
041    import java.sql.Types;
042    
043    import java.util.ArrayList;
044    import java.util.Date;
045    import java.util.List;
046    import java.util.Locale;
047    import java.util.Map;
048    
049    /**
050     * The base model implementation for the AssetEntry service. Represents a row in the "AssetEntry" database table, with each column mapped to a property of this class.
051     *
052     * <p>
053     * This implementation and its corresponding interface {@link com.liferay.portlet.asset.model.AssetEntryModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link AssetEntryImpl}.
054     * </p>
055     *
056     * @author Brian Wing Shun Chan
057     * @see AssetEntryImpl
058     * @see com.liferay.portlet.asset.model.AssetEntry
059     * @see com.liferay.portlet.asset.model.AssetEntryModel
060     * @generated
061     */
062    @JSON(strict = true)
063    public class AssetEntryModelImpl extends BaseModelImpl<AssetEntry>
064            implements AssetEntryModel {
065            /*
066             * NOTE FOR DEVELOPERS:
067             *
068             * Never modify or reference this class directly. All methods that expect a asset entry model instance should use the {@link com.liferay.portlet.asset.model.AssetEntry} interface instead.
069             */
070            public static final String TABLE_NAME = "AssetEntry";
071            public static final Object[][] TABLE_COLUMNS = {
072                            { "entryId", Types.BIGINT },
073                            { "groupId", Types.BIGINT },
074                            { "companyId", Types.BIGINT },
075                            { "userId", Types.BIGINT },
076                            { "userName", Types.VARCHAR },
077                            { "createDate", Types.TIMESTAMP },
078                            { "modifiedDate", Types.TIMESTAMP },
079                            { "classNameId", Types.BIGINT },
080                            { "classPK", Types.BIGINT },
081                            { "classUuid", Types.VARCHAR },
082                            { "classTypeId", Types.BIGINT },
083                            { "visible", Types.BOOLEAN },
084                            { "startDate", Types.TIMESTAMP },
085                            { "endDate", Types.TIMESTAMP },
086                            { "publishDate", Types.TIMESTAMP },
087                            { "expirationDate", Types.TIMESTAMP },
088                            { "mimeType", Types.VARCHAR },
089                            { "title", Types.VARCHAR },
090                            { "description", Types.VARCHAR },
091                            { "summary", Types.VARCHAR },
092                            { "url", Types.VARCHAR },
093                            { "layoutUuid", Types.VARCHAR },
094                            { "height", Types.INTEGER },
095                            { "width", Types.INTEGER },
096                            { "priority", Types.DOUBLE },
097                            { "viewCount", Types.INTEGER }
098                    };
099            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,classUuid VARCHAR(75) null,classTypeId LONG,visible BOOLEAN,startDate DATE null,endDate DATE null,publishDate DATE null,expirationDate DATE null,mimeType VARCHAR(75) null,title STRING null,description STRING null,summary STRING null,url STRING null,layoutUuid VARCHAR(75) null,height INTEGER,width INTEGER,priority DOUBLE,viewCount INTEGER)";
100            public static final String TABLE_SQL_DROP = "drop table AssetEntry";
101            public static final String DATA_SOURCE = "liferayDataSource";
102            public static final String SESSION_FACTORY = "liferaySessionFactory";
103            public static final String TX_MANAGER = "liferayTransactionManager";
104            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
105                                    "value.object.entity.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
106                            true);
107            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
108                                    "value.object.finder.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
109                            true);
110            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
111                                    "value.object.column.bitmask.enabled.com.liferay.portlet.asset.model.AssetEntry"),
112                            true);
113            public static long CLASSNAMEID_COLUMN_BITMASK = 1L;
114            public static long CLASSPK_COLUMN_BITMASK = 2L;
115            public static long CLASSUUID_COLUMN_BITMASK = 4L;
116            public static long COMPANYID_COLUMN_BITMASK = 8L;
117            public static long EXPIRATIONDATE_COLUMN_BITMASK = 16L;
118            public static long GROUPID_COLUMN_BITMASK = 32L;
119            public static long PUBLISHDATE_COLUMN_BITMASK = 64L;
120            public static long VISIBLE_COLUMN_BITMASK = 128L;
121    
122            /**
123             * Converts the soap model instance into a normal model instance.
124             *
125             * @param soapModel the soap model instance to convert
126             * @return the normal model instance
127             */
128            public static AssetEntry toModel(AssetEntrySoap soapModel) {
129                    AssetEntry model = new AssetEntryImpl();
130    
131                    model.setEntryId(soapModel.getEntryId());
132                    model.setGroupId(soapModel.getGroupId());
133                    model.setCompanyId(soapModel.getCompanyId());
134                    model.setUserId(soapModel.getUserId());
135                    model.setUserName(soapModel.getUserName());
136                    model.setCreateDate(soapModel.getCreateDate());
137                    model.setModifiedDate(soapModel.getModifiedDate());
138                    model.setClassNameId(soapModel.getClassNameId());
139                    model.setClassPK(soapModel.getClassPK());
140                    model.setClassUuid(soapModel.getClassUuid());
141                    model.setClassTypeId(soapModel.getClassTypeId());
142                    model.setVisible(soapModel.getVisible());
143                    model.setStartDate(soapModel.getStartDate());
144                    model.setEndDate(soapModel.getEndDate());
145                    model.setPublishDate(soapModel.getPublishDate());
146                    model.setExpirationDate(soapModel.getExpirationDate());
147                    model.setMimeType(soapModel.getMimeType());
148                    model.setTitle(soapModel.getTitle());
149                    model.setDescription(soapModel.getDescription());
150                    model.setSummary(soapModel.getSummary());
151                    model.setUrl(soapModel.getUrl());
152                    model.setLayoutUuid(soapModel.getLayoutUuid());
153                    model.setHeight(soapModel.getHeight());
154                    model.setWidth(soapModel.getWidth());
155                    model.setPriority(soapModel.getPriority());
156                    model.setViewCount(soapModel.getViewCount());
157    
158                    return model;
159            }
160    
161            /**
162             * Converts the soap model instances into normal model instances.
163             *
164             * @param soapModels the soap model instances to convert
165             * @return the normal model instances
166             */
167            public static List<AssetEntry> toModels(AssetEntrySoap[] soapModels) {
168                    List<AssetEntry> models = new ArrayList<AssetEntry>(soapModels.length);
169    
170                    for (AssetEntrySoap soapModel : soapModels) {
171                            models.add(toModel(soapModel));
172                    }
173    
174                    return models;
175            }
176    
177            public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_NAME = "AssetEntries_AssetCategories";
178            public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_COLUMNS =
179                    {
180                            { "entryId", Types.BIGINT },
181                            { "categoryId", Types.BIGINT }
182                    };
183            public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_SQL_CREATE =
184                    "create table AssetEntries_AssetCategories (entryId LONG not null,categoryId LONG not null,primary key (entryId, categoryId))";
185            public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETCATEGORIES =
186                    GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
187                                    "value.object.finder.cache.enabled.AssetEntries_AssetCategories"),
188                            true);
189            public static final String MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_NAME = "AssetEntries_AssetTags";
190            public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_COLUMNS = {
191                            { "entryId", Types.BIGINT },
192                            { "tagId", Types.BIGINT }
193                    };
194            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))";
195            public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETTAGS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
196                                    "value.object.finder.cache.enabled.AssetEntries_AssetTags"),
197                            true);
198            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
199                                    "lock.expiration.time.com.liferay.portlet.asset.model.AssetEntry"));
200    
201            public AssetEntryModelImpl() {
202            }
203    
204            public long getPrimaryKey() {
205                    return _entryId;
206            }
207    
208            public void setPrimaryKey(long primaryKey) {
209                    setEntryId(primaryKey);
210            }
211    
212            public Serializable getPrimaryKeyObj() {
213                    return new Long(_entryId);
214            }
215    
216            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
217                    setPrimaryKey(((Long)primaryKeyObj).longValue());
218            }
219    
220            public Class<?> getModelClass() {
221                    return AssetEntry.class;
222            }
223    
224            public String getModelClassName() {
225                    return AssetEntry.class.getName();
226            }
227    
228            @JSON
229            public long getEntryId() {
230                    return _entryId;
231            }
232    
233            public void setEntryId(long entryId) {
234                    _entryId = entryId;
235            }
236    
237            @JSON
238            public long getGroupId() {
239                    return _groupId;
240            }
241    
242            public void setGroupId(long groupId) {
243                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
244    
245                    if (!_setOriginalGroupId) {
246                            _setOriginalGroupId = true;
247    
248                            _originalGroupId = _groupId;
249                    }
250    
251                    _groupId = groupId;
252            }
253    
254            public long getOriginalGroupId() {
255                    return _originalGroupId;
256            }
257    
258            @JSON
259            public long getCompanyId() {
260                    return _companyId;
261            }
262    
263            public void setCompanyId(long companyId) {
264                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
265    
266                    if (!_setOriginalCompanyId) {
267                            _setOriginalCompanyId = true;
268    
269                            _originalCompanyId = _companyId;
270                    }
271    
272                    _companyId = companyId;
273            }
274    
275            public long getOriginalCompanyId() {
276                    return _originalCompanyId;
277            }
278    
279            @JSON
280            public long getUserId() {
281                    return _userId;
282            }
283    
284            public void setUserId(long userId) {
285                    _userId = userId;
286            }
287    
288            public String getUserUuid() throws SystemException {
289                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
290            }
291    
292            public void setUserUuid(String userUuid) {
293                    _userUuid = userUuid;
294            }
295    
296            @JSON
297            public String getUserName() {
298                    if (_userName == null) {
299                            return StringPool.BLANK;
300                    }
301                    else {
302                            return _userName;
303                    }
304            }
305    
306            public void setUserName(String userName) {
307                    _userName = userName;
308            }
309    
310            @JSON
311            public Date getCreateDate() {
312                    return _createDate;
313            }
314    
315            public void setCreateDate(Date createDate) {
316                    _createDate = createDate;
317            }
318    
319            @JSON
320            public Date getModifiedDate() {
321                    return _modifiedDate;
322            }
323    
324            public void setModifiedDate(Date modifiedDate) {
325                    _modifiedDate = modifiedDate;
326            }
327    
328            public String getClassName() {
329                    if (getClassNameId() <= 0) {
330                            return StringPool.BLANK;
331                    }
332    
333                    return PortalUtil.getClassName(getClassNameId());
334            }
335    
336            @JSON
337            public long getClassNameId() {
338                    return _classNameId;
339            }
340    
341            public void setClassNameId(long classNameId) {
342                    _columnBitmask |= CLASSNAMEID_COLUMN_BITMASK;
343    
344                    if (!_setOriginalClassNameId) {
345                            _setOriginalClassNameId = true;
346    
347                            _originalClassNameId = _classNameId;
348                    }
349    
350                    _classNameId = classNameId;
351            }
352    
353            public long getOriginalClassNameId() {
354                    return _originalClassNameId;
355            }
356    
357            @JSON
358            public long getClassPK() {
359                    return _classPK;
360            }
361    
362            public void setClassPK(long classPK) {
363                    _columnBitmask |= CLASSPK_COLUMN_BITMASK;
364    
365                    if (!_setOriginalClassPK) {
366                            _setOriginalClassPK = true;
367    
368                            _originalClassPK = _classPK;
369                    }
370    
371                    _classPK = classPK;
372            }
373    
374            public long getOriginalClassPK() {
375                    return _originalClassPK;
376            }
377    
378            @JSON
379            public String getClassUuid() {
380                    if (_classUuid == null) {
381                            return StringPool.BLANK;
382                    }
383                    else {
384                            return _classUuid;
385                    }
386            }
387    
388            public void setClassUuid(String classUuid) {
389                    _columnBitmask |= CLASSUUID_COLUMN_BITMASK;
390    
391                    if (_originalClassUuid == null) {
392                            _originalClassUuid = _classUuid;
393                    }
394    
395                    _classUuid = classUuid;
396            }
397    
398            public String getOriginalClassUuid() {
399                    return GetterUtil.getString(_originalClassUuid);
400            }
401    
402            @JSON
403            public long getClassTypeId() {
404                    return _classTypeId;
405            }
406    
407            public void setClassTypeId(long classTypeId) {
408                    _classTypeId = classTypeId;
409            }
410    
411            @JSON
412            public boolean getVisible() {
413                    return _visible;
414            }
415    
416            public boolean isVisible() {
417                    return _visible;
418            }
419    
420            public void setVisible(boolean visible) {
421                    _columnBitmask |= VISIBLE_COLUMN_BITMASK;
422    
423                    if (!_setOriginalVisible) {
424                            _setOriginalVisible = true;
425    
426                            _originalVisible = _visible;
427                    }
428    
429                    _visible = visible;
430            }
431    
432            public boolean getOriginalVisible() {
433                    return _originalVisible;
434            }
435    
436            @JSON
437            public Date getStartDate() {
438                    return _startDate;
439            }
440    
441            public void setStartDate(Date startDate) {
442                    _startDate = startDate;
443            }
444    
445            @JSON
446            public Date getEndDate() {
447                    return _endDate;
448            }
449    
450            public void setEndDate(Date endDate) {
451                    _endDate = endDate;
452            }
453    
454            @JSON
455            public Date getPublishDate() {
456                    return _publishDate;
457            }
458    
459            public void setPublishDate(Date publishDate) {
460                    _columnBitmask |= PUBLISHDATE_COLUMN_BITMASK;
461    
462                    if (_originalPublishDate == null) {
463                            _originalPublishDate = _publishDate;
464                    }
465    
466                    _publishDate = publishDate;
467            }
468    
469            public Date getOriginalPublishDate() {
470                    return _originalPublishDate;
471            }
472    
473            @JSON
474            public Date getExpirationDate() {
475                    return _expirationDate;
476            }
477    
478            public void setExpirationDate(Date expirationDate) {
479                    _columnBitmask |= EXPIRATIONDATE_COLUMN_BITMASK;
480    
481                    if (_originalExpirationDate == null) {
482                            _originalExpirationDate = _expirationDate;
483                    }
484    
485                    _expirationDate = expirationDate;
486            }
487    
488            public Date getOriginalExpirationDate() {
489                    return _originalExpirationDate;
490            }
491    
492            @JSON
493            public String getMimeType() {
494                    if (_mimeType == null) {
495                            return StringPool.BLANK;
496                    }
497                    else {
498                            return _mimeType;
499                    }
500            }
501    
502            public void setMimeType(String mimeType) {
503                    _mimeType = mimeType;
504            }
505    
506            @JSON
507            public String getTitle() {
508                    if (_title == null) {
509                            return StringPool.BLANK;
510                    }
511                    else {
512                            return _title;
513                    }
514            }
515    
516            public String getTitle(Locale locale) {
517                    String languageId = LocaleUtil.toLanguageId(locale);
518    
519                    return getTitle(languageId);
520            }
521    
522            public String getTitle(Locale locale, boolean useDefault) {
523                    String languageId = LocaleUtil.toLanguageId(locale);
524    
525                    return getTitle(languageId, useDefault);
526            }
527    
528            public String getTitle(String languageId) {
529                    return LocalizationUtil.getLocalization(getTitle(), languageId);
530            }
531    
532            public String getTitle(String languageId, boolean useDefault) {
533                    return LocalizationUtil.getLocalization(getTitle(), languageId,
534                            useDefault);
535            }
536    
537            public String getTitleCurrentLanguageId() {
538                    return _titleCurrentLanguageId;
539            }
540    
541            @JSON
542            public String getTitleCurrentValue() {
543                    Locale locale = getLocale(_titleCurrentLanguageId);
544    
545                    return getTitle(locale);
546            }
547    
548            public Map<Locale, String> getTitleMap() {
549                    return LocalizationUtil.getLocalizationMap(getTitle());
550            }
551    
552            public void setTitle(String title) {
553                    _title = title;
554            }
555    
556            public void setTitle(String title, Locale locale) {
557                    setTitle(title, locale, LocaleUtil.getDefault());
558            }
559    
560            public void setTitle(String title, Locale locale, Locale defaultLocale) {
561                    String languageId = LocaleUtil.toLanguageId(locale);
562                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
563    
564                    if (Validator.isNotNull(title)) {
565                            setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
566                                            title, languageId, defaultLanguageId));
567                    }
568                    else {
569                            setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
570                                            languageId));
571                    }
572            }
573    
574            public void setTitleCurrentLanguageId(String languageId) {
575                    _titleCurrentLanguageId = languageId;
576            }
577    
578            public void setTitleMap(Map<Locale, String> titleMap) {
579                    setTitleMap(titleMap, LocaleUtil.getDefault());
580            }
581    
582            public void setTitleMap(Map<Locale, String> titleMap, Locale defaultLocale) {
583                    if (titleMap == null) {
584                            return;
585                    }
586    
587                    Locale[] locales = LanguageUtil.getAvailableLocales();
588    
589                    for (Locale locale : locales) {
590                            String title = titleMap.get(locale);
591    
592                            setTitle(title, locale, defaultLocale);
593                    }
594            }
595    
596            @JSON
597            public String getDescription() {
598                    if (_description == null) {
599                            return StringPool.BLANK;
600                    }
601                    else {
602                            return _description;
603                    }
604            }
605    
606            public String getDescription(Locale locale) {
607                    String languageId = LocaleUtil.toLanguageId(locale);
608    
609                    return getDescription(languageId);
610            }
611    
612            public String getDescription(Locale locale, boolean useDefault) {
613                    String languageId = LocaleUtil.toLanguageId(locale);
614    
615                    return getDescription(languageId, useDefault);
616            }
617    
618            public String getDescription(String languageId) {
619                    return LocalizationUtil.getLocalization(getDescription(), languageId);
620            }
621    
622            public String getDescription(String languageId, boolean useDefault) {
623                    return LocalizationUtil.getLocalization(getDescription(), languageId,
624                            useDefault);
625            }
626    
627            public String getDescriptionCurrentLanguageId() {
628                    return _descriptionCurrentLanguageId;
629            }
630    
631            @JSON
632            public String getDescriptionCurrentValue() {
633                    Locale locale = getLocale(_descriptionCurrentLanguageId);
634    
635                    return getDescription(locale);
636            }
637    
638            public Map<Locale, String> getDescriptionMap() {
639                    return LocalizationUtil.getLocalizationMap(getDescription());
640            }
641    
642            public void setDescription(String description) {
643                    _description = description;
644            }
645    
646            public void setDescription(String description, Locale locale) {
647                    setDescription(description, locale, LocaleUtil.getDefault());
648            }
649    
650            public void setDescription(String description, Locale locale,
651                    Locale defaultLocale) {
652                    String languageId = LocaleUtil.toLanguageId(locale);
653                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
654    
655                    if (Validator.isNotNull(description)) {
656                            setDescription(LocalizationUtil.updateLocalization(
657                                            getDescription(), "Description", description, languageId,
658                                            defaultLanguageId));
659                    }
660                    else {
661                            setDescription(LocalizationUtil.removeLocalization(
662                                            getDescription(), "Description", languageId));
663                    }
664            }
665    
666            public void setDescriptionCurrentLanguageId(String languageId) {
667                    _descriptionCurrentLanguageId = languageId;
668            }
669    
670            public void setDescriptionMap(Map<Locale, String> descriptionMap) {
671                    setDescriptionMap(descriptionMap, LocaleUtil.getDefault());
672            }
673    
674            public void setDescriptionMap(Map<Locale, String> descriptionMap,
675                    Locale defaultLocale) {
676                    if (descriptionMap == null) {
677                            return;
678                    }
679    
680                    Locale[] locales = LanguageUtil.getAvailableLocales();
681    
682                    for (Locale locale : locales) {
683                            String description = descriptionMap.get(locale);
684    
685                            setDescription(description, locale, defaultLocale);
686                    }
687            }
688    
689            @JSON
690            public String getSummary() {
691                    if (_summary == null) {
692                            return StringPool.BLANK;
693                    }
694                    else {
695                            return _summary;
696                    }
697            }
698    
699            public String getSummary(Locale locale) {
700                    String languageId = LocaleUtil.toLanguageId(locale);
701    
702                    return getSummary(languageId);
703            }
704    
705            public String getSummary(Locale locale, boolean useDefault) {
706                    String languageId = LocaleUtil.toLanguageId(locale);
707    
708                    return getSummary(languageId, useDefault);
709            }
710    
711            public String getSummary(String languageId) {
712                    return LocalizationUtil.getLocalization(getSummary(), languageId);
713            }
714    
715            public String getSummary(String languageId, boolean useDefault) {
716                    return LocalizationUtil.getLocalization(getSummary(), languageId,
717                            useDefault);
718            }
719    
720            public String getSummaryCurrentLanguageId() {
721                    return _summaryCurrentLanguageId;
722            }
723    
724            @JSON
725            public String getSummaryCurrentValue() {
726                    Locale locale = getLocale(_summaryCurrentLanguageId);
727    
728                    return getSummary(locale);
729            }
730    
731            public Map<Locale, String> getSummaryMap() {
732                    return LocalizationUtil.getLocalizationMap(getSummary());
733            }
734    
735            public void setSummary(String summary) {
736                    _summary = summary;
737            }
738    
739            public void setSummary(String summary, Locale locale) {
740                    setSummary(summary, locale, LocaleUtil.getDefault());
741            }
742    
743            public void setSummary(String summary, Locale locale, Locale defaultLocale) {
744                    String languageId = LocaleUtil.toLanguageId(locale);
745                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
746    
747                    if (Validator.isNotNull(summary)) {
748                            setSummary(LocalizationUtil.updateLocalization(getSummary(),
749                                            "Summary", summary, languageId, defaultLanguageId));
750                    }
751                    else {
752                            setSummary(LocalizationUtil.removeLocalization(getSummary(),
753                                            "Summary", languageId));
754                    }
755            }
756    
757            public void setSummaryCurrentLanguageId(String languageId) {
758                    _summaryCurrentLanguageId = languageId;
759            }
760    
761            public void setSummaryMap(Map<Locale, String> summaryMap) {
762                    setSummaryMap(summaryMap, LocaleUtil.getDefault());
763            }
764    
765            public void setSummaryMap(Map<Locale, String> summaryMap,
766                    Locale defaultLocale) {
767                    if (summaryMap == null) {
768                            return;
769                    }
770    
771                    Locale[] locales = LanguageUtil.getAvailableLocales();
772    
773                    for (Locale locale : locales) {
774                            String summary = summaryMap.get(locale);
775    
776                            setSummary(summary, locale, defaultLocale);
777                    }
778            }
779    
780            @JSON
781            public String getUrl() {
782                    if (_url == null) {
783                            return StringPool.BLANK;
784                    }
785                    else {
786                            return _url;
787                    }
788            }
789    
790            public void setUrl(String url) {
791                    _url = url;
792            }
793    
794            @JSON
795            public String getLayoutUuid() {
796                    if (_layoutUuid == null) {
797                            return StringPool.BLANK;
798                    }
799                    else {
800                            return _layoutUuid;
801                    }
802            }
803    
804            public void setLayoutUuid(String layoutUuid) {
805                    _layoutUuid = layoutUuid;
806            }
807    
808            @JSON
809            public int getHeight() {
810                    return _height;
811            }
812    
813            public void setHeight(int height) {
814                    _height = height;
815            }
816    
817            @JSON
818            public int getWidth() {
819                    return _width;
820            }
821    
822            public void setWidth(int width) {
823                    _width = width;
824            }
825    
826            @JSON
827            public double getPriority() {
828                    return _priority;
829            }
830    
831            public void setPriority(double priority) {
832                    _priority = priority;
833            }
834    
835            @JSON
836            public int getViewCount() {
837                    return _viewCount;
838            }
839    
840            public void setViewCount(int viewCount) {
841                    _viewCount = viewCount;
842            }
843    
844            public long getColumnBitmask() {
845                    return _columnBitmask;
846            }
847    
848            @Override
849            public AssetEntry toEscapedModel() {
850                    if (_escapedModelProxy == null) {
851                            _escapedModelProxy = (AssetEntry)ProxyUtil.newProxyInstance(_classLoader,
852                                            _escapedModelProxyInterfaces,
853                                            new AutoEscapeBeanHandler(this));
854                    }
855    
856                    return _escapedModelProxy;
857            }
858    
859            @Override
860            public ExpandoBridge getExpandoBridge() {
861                    if (_expandoBridge == null) {
862                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
863                                            AssetEntry.class.getName(), getPrimaryKey());
864                    }
865    
866                    return _expandoBridge;
867            }
868    
869            @Override
870            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
871                    getExpandoBridge().setAttributes(serviceContext);
872            }
873    
874            @Override
875            public Object clone() {
876                    AssetEntryImpl assetEntryImpl = new AssetEntryImpl();
877    
878                    assetEntryImpl.setEntryId(getEntryId());
879                    assetEntryImpl.setGroupId(getGroupId());
880                    assetEntryImpl.setCompanyId(getCompanyId());
881                    assetEntryImpl.setUserId(getUserId());
882                    assetEntryImpl.setUserName(getUserName());
883                    assetEntryImpl.setCreateDate(getCreateDate());
884                    assetEntryImpl.setModifiedDate(getModifiedDate());
885                    assetEntryImpl.setClassNameId(getClassNameId());
886                    assetEntryImpl.setClassPK(getClassPK());
887                    assetEntryImpl.setClassUuid(getClassUuid());
888                    assetEntryImpl.setClassTypeId(getClassTypeId());
889                    assetEntryImpl.setVisible(getVisible());
890                    assetEntryImpl.setStartDate(getStartDate());
891                    assetEntryImpl.setEndDate(getEndDate());
892                    assetEntryImpl.setPublishDate(getPublishDate());
893                    assetEntryImpl.setExpirationDate(getExpirationDate());
894                    assetEntryImpl.setMimeType(getMimeType());
895                    assetEntryImpl.setTitle(getTitle());
896                    assetEntryImpl.setDescription(getDescription());
897                    assetEntryImpl.setSummary(getSummary());
898                    assetEntryImpl.setUrl(getUrl());
899                    assetEntryImpl.setLayoutUuid(getLayoutUuid());
900                    assetEntryImpl.setHeight(getHeight());
901                    assetEntryImpl.setWidth(getWidth());
902                    assetEntryImpl.setPriority(getPriority());
903                    assetEntryImpl.setViewCount(getViewCount());
904    
905                    assetEntryImpl.resetOriginalValues();
906    
907                    return assetEntryImpl;
908            }
909    
910            public int compareTo(AssetEntry assetEntry) {
911                    long primaryKey = assetEntry.getPrimaryKey();
912    
913                    if (getPrimaryKey() < primaryKey) {
914                            return -1;
915                    }
916                    else if (getPrimaryKey() > primaryKey) {
917                            return 1;
918                    }
919                    else {
920                            return 0;
921                    }
922            }
923    
924            @Override
925            public boolean equals(Object obj) {
926                    if (obj == null) {
927                            return false;
928                    }
929    
930                    AssetEntry assetEntry = null;
931    
932                    try {
933                            assetEntry = (AssetEntry)obj;
934                    }
935                    catch (ClassCastException cce) {
936                            return false;
937                    }
938    
939                    long primaryKey = assetEntry.getPrimaryKey();
940    
941                    if (getPrimaryKey() == primaryKey) {
942                            return true;
943                    }
944                    else {
945                            return false;
946                    }
947            }
948    
949            @Override
950            public int hashCode() {
951                    return (int)getPrimaryKey();
952            }
953    
954            @Override
955            public void resetOriginalValues() {
956                    AssetEntryModelImpl assetEntryModelImpl = this;
957    
958                    assetEntryModelImpl._originalGroupId = assetEntryModelImpl._groupId;
959    
960                    assetEntryModelImpl._setOriginalGroupId = false;
961    
962                    assetEntryModelImpl._originalCompanyId = assetEntryModelImpl._companyId;
963    
964                    assetEntryModelImpl._setOriginalCompanyId = false;
965    
966                    assetEntryModelImpl._originalClassNameId = assetEntryModelImpl._classNameId;
967    
968                    assetEntryModelImpl._setOriginalClassNameId = false;
969    
970                    assetEntryModelImpl._originalClassPK = assetEntryModelImpl._classPK;
971    
972                    assetEntryModelImpl._setOriginalClassPK = false;
973    
974                    assetEntryModelImpl._originalClassUuid = assetEntryModelImpl._classUuid;
975    
976                    assetEntryModelImpl._originalVisible = assetEntryModelImpl._visible;
977    
978                    assetEntryModelImpl._setOriginalVisible = false;
979    
980                    assetEntryModelImpl._originalPublishDate = assetEntryModelImpl._publishDate;
981    
982                    assetEntryModelImpl._originalExpirationDate = assetEntryModelImpl._expirationDate;
983    
984                    assetEntryModelImpl._columnBitmask = 0;
985            }
986    
987            @Override
988            public CacheModel<AssetEntry> toCacheModel() {
989                    AssetEntryCacheModel assetEntryCacheModel = new AssetEntryCacheModel();
990    
991                    assetEntryCacheModel.entryId = getEntryId();
992    
993                    assetEntryCacheModel.groupId = getGroupId();
994    
995                    assetEntryCacheModel.companyId = getCompanyId();
996    
997                    assetEntryCacheModel.userId = getUserId();
998    
999                    assetEntryCacheModel.userName = getUserName();
1000    
1001                    String userName = assetEntryCacheModel.userName;
1002    
1003                    if ((userName != null) && (userName.length() == 0)) {
1004                            assetEntryCacheModel.userName = null;
1005                    }
1006    
1007                    Date createDate = getCreateDate();
1008    
1009                    if (createDate != null) {
1010                            assetEntryCacheModel.createDate = createDate.getTime();
1011                    }
1012                    else {
1013                            assetEntryCacheModel.createDate = Long.MIN_VALUE;
1014                    }
1015    
1016                    Date modifiedDate = getModifiedDate();
1017    
1018                    if (modifiedDate != null) {
1019                            assetEntryCacheModel.modifiedDate = modifiedDate.getTime();
1020                    }
1021                    else {
1022                            assetEntryCacheModel.modifiedDate = Long.MIN_VALUE;
1023                    }
1024    
1025                    assetEntryCacheModel.classNameId = getClassNameId();
1026    
1027                    assetEntryCacheModel.classPK = getClassPK();
1028    
1029                    assetEntryCacheModel.classUuid = getClassUuid();
1030    
1031                    String classUuid = assetEntryCacheModel.classUuid;
1032    
1033                    if ((classUuid != null) && (classUuid.length() == 0)) {
1034                            assetEntryCacheModel.classUuid = null;
1035                    }
1036    
1037                    assetEntryCacheModel.classTypeId = getClassTypeId();
1038    
1039                    assetEntryCacheModel.visible = getVisible();
1040    
1041                    Date startDate = getStartDate();
1042    
1043                    if (startDate != null) {
1044                            assetEntryCacheModel.startDate = startDate.getTime();
1045                    }
1046                    else {
1047                            assetEntryCacheModel.startDate = Long.MIN_VALUE;
1048                    }
1049    
1050                    Date endDate = getEndDate();
1051    
1052                    if (endDate != null) {
1053                            assetEntryCacheModel.endDate = endDate.getTime();
1054                    }
1055                    else {
1056                            assetEntryCacheModel.endDate = Long.MIN_VALUE;
1057                    }
1058    
1059                    Date publishDate = getPublishDate();
1060    
1061                    if (publishDate != null) {
1062                            assetEntryCacheModel.publishDate = publishDate.getTime();
1063                    }
1064                    else {
1065                            assetEntryCacheModel.publishDate = Long.MIN_VALUE;
1066                    }
1067    
1068                    Date expirationDate = getExpirationDate();
1069    
1070                    if (expirationDate != null) {
1071                            assetEntryCacheModel.expirationDate = expirationDate.getTime();
1072                    }
1073                    else {
1074                            assetEntryCacheModel.expirationDate = Long.MIN_VALUE;
1075                    }
1076    
1077                    assetEntryCacheModel.mimeType = getMimeType();
1078    
1079                    String mimeType = assetEntryCacheModel.mimeType;
1080    
1081                    if ((mimeType != null) && (mimeType.length() == 0)) {
1082                            assetEntryCacheModel.mimeType = null;
1083                    }
1084    
1085                    assetEntryCacheModel.title = getTitle();
1086    
1087                    String title = assetEntryCacheModel.title;
1088    
1089                    if ((title != null) && (title.length() == 0)) {
1090                            assetEntryCacheModel.title = null;
1091                    }
1092    
1093                    assetEntryCacheModel.description = getDescription();
1094    
1095                    String description = assetEntryCacheModel.description;
1096    
1097                    if ((description != null) && (description.length() == 0)) {
1098                            assetEntryCacheModel.description = null;
1099                    }
1100    
1101                    assetEntryCacheModel.summary = getSummary();
1102    
1103                    String summary = assetEntryCacheModel.summary;
1104    
1105                    if ((summary != null) && (summary.length() == 0)) {
1106                            assetEntryCacheModel.summary = null;
1107                    }
1108    
1109                    assetEntryCacheModel.url = getUrl();
1110    
1111                    String url = assetEntryCacheModel.url;
1112    
1113                    if ((url != null) && (url.length() == 0)) {
1114                            assetEntryCacheModel.url = null;
1115                    }
1116    
1117                    assetEntryCacheModel.layoutUuid = getLayoutUuid();
1118    
1119                    String layoutUuid = assetEntryCacheModel.layoutUuid;
1120    
1121                    if ((layoutUuid != null) && (layoutUuid.length() == 0)) {
1122                            assetEntryCacheModel.layoutUuid = null;
1123                    }
1124    
1125                    assetEntryCacheModel.height = getHeight();
1126    
1127                    assetEntryCacheModel.width = getWidth();
1128    
1129                    assetEntryCacheModel.priority = getPriority();
1130    
1131                    assetEntryCacheModel.viewCount = getViewCount();
1132    
1133                    return assetEntryCacheModel;
1134            }
1135    
1136            @Override
1137            public String toString() {
1138                    StringBundler sb = new StringBundler(53);
1139    
1140                    sb.append("{entryId=");
1141                    sb.append(getEntryId());
1142                    sb.append(", groupId=");
1143                    sb.append(getGroupId());
1144                    sb.append(", companyId=");
1145                    sb.append(getCompanyId());
1146                    sb.append(", userId=");
1147                    sb.append(getUserId());
1148                    sb.append(", userName=");
1149                    sb.append(getUserName());
1150                    sb.append(", createDate=");
1151                    sb.append(getCreateDate());
1152                    sb.append(", modifiedDate=");
1153                    sb.append(getModifiedDate());
1154                    sb.append(", classNameId=");
1155                    sb.append(getClassNameId());
1156                    sb.append(", classPK=");
1157                    sb.append(getClassPK());
1158                    sb.append(", classUuid=");
1159                    sb.append(getClassUuid());
1160                    sb.append(", classTypeId=");
1161                    sb.append(getClassTypeId());
1162                    sb.append(", visible=");
1163                    sb.append(getVisible());
1164                    sb.append(", startDate=");
1165                    sb.append(getStartDate());
1166                    sb.append(", endDate=");
1167                    sb.append(getEndDate());
1168                    sb.append(", publishDate=");
1169                    sb.append(getPublishDate());
1170                    sb.append(", expirationDate=");
1171                    sb.append(getExpirationDate());
1172                    sb.append(", mimeType=");
1173                    sb.append(getMimeType());
1174                    sb.append(", title=");
1175                    sb.append(getTitle());
1176                    sb.append(", description=");
1177                    sb.append(getDescription());
1178                    sb.append(", summary=");
1179                    sb.append(getSummary());
1180                    sb.append(", url=");
1181                    sb.append(getUrl());
1182                    sb.append(", layoutUuid=");
1183                    sb.append(getLayoutUuid());
1184                    sb.append(", height=");
1185                    sb.append(getHeight());
1186                    sb.append(", width=");
1187                    sb.append(getWidth());
1188                    sb.append(", priority=");
1189                    sb.append(getPriority());
1190                    sb.append(", viewCount=");
1191                    sb.append(getViewCount());
1192                    sb.append("}");
1193    
1194                    return sb.toString();
1195            }
1196    
1197            public String toXmlString() {
1198                    StringBundler sb = new StringBundler(82);
1199    
1200                    sb.append("<model><model-name>");
1201                    sb.append("com.liferay.portlet.asset.model.AssetEntry");
1202                    sb.append("</model-name>");
1203    
1204                    sb.append(
1205                            "<column><column-name>entryId</column-name><column-value><![CDATA[");
1206                    sb.append(getEntryId());
1207                    sb.append("]]></column-value></column>");
1208                    sb.append(
1209                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1210                    sb.append(getGroupId());
1211                    sb.append("]]></column-value></column>");
1212                    sb.append(
1213                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1214                    sb.append(getCompanyId());
1215                    sb.append("]]></column-value></column>");
1216                    sb.append(
1217                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1218                    sb.append(getUserId());
1219                    sb.append("]]></column-value></column>");
1220                    sb.append(
1221                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1222                    sb.append(getUserName());
1223                    sb.append("]]></column-value></column>");
1224                    sb.append(
1225                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1226                    sb.append(getCreateDate());
1227                    sb.append("]]></column-value></column>");
1228                    sb.append(
1229                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1230                    sb.append(getModifiedDate());
1231                    sb.append("]]></column-value></column>");
1232                    sb.append(
1233                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
1234                    sb.append(getClassNameId());
1235                    sb.append("]]></column-value></column>");
1236                    sb.append(
1237                            "<column><column-name>classPK</column-name><column-value><![CDATA[");
1238                    sb.append(getClassPK());
1239                    sb.append("]]></column-value></column>");
1240                    sb.append(
1241                            "<column><column-name>classUuid</column-name><column-value><![CDATA[");
1242                    sb.append(getClassUuid());
1243                    sb.append("]]></column-value></column>");
1244                    sb.append(
1245                            "<column><column-name>classTypeId</column-name><column-value><![CDATA[");
1246                    sb.append(getClassTypeId());
1247                    sb.append("]]></column-value></column>");
1248                    sb.append(
1249                            "<column><column-name>visible</column-name><column-value><![CDATA[");
1250                    sb.append(getVisible());
1251                    sb.append("]]></column-value></column>");
1252                    sb.append(
1253                            "<column><column-name>startDate</column-name><column-value><![CDATA[");
1254                    sb.append(getStartDate());
1255                    sb.append("]]></column-value></column>");
1256                    sb.append(
1257                            "<column><column-name>endDate</column-name><column-value><![CDATA[");
1258                    sb.append(getEndDate());
1259                    sb.append("]]></column-value></column>");
1260                    sb.append(
1261                            "<column><column-name>publishDate</column-name><column-value><![CDATA[");
1262                    sb.append(getPublishDate());
1263                    sb.append("]]></column-value></column>");
1264                    sb.append(
1265                            "<column><column-name>expirationDate</column-name><column-value><![CDATA[");
1266                    sb.append(getExpirationDate());
1267                    sb.append("]]></column-value></column>");
1268                    sb.append(
1269                            "<column><column-name>mimeType</column-name><column-value><![CDATA[");
1270                    sb.append(getMimeType());
1271                    sb.append("]]></column-value></column>");
1272                    sb.append(
1273                            "<column><column-name>title</column-name><column-value><![CDATA[");
1274                    sb.append(getTitle());
1275                    sb.append("]]></column-value></column>");
1276                    sb.append(
1277                            "<column><column-name>description</column-name><column-value><![CDATA[");
1278                    sb.append(getDescription());
1279                    sb.append("]]></column-value></column>");
1280                    sb.append(
1281                            "<column><column-name>summary</column-name><column-value><![CDATA[");
1282                    sb.append(getSummary());
1283                    sb.append("]]></column-value></column>");
1284                    sb.append(
1285                            "<column><column-name>url</column-name><column-value><![CDATA[");
1286                    sb.append(getUrl());
1287                    sb.append("]]></column-value></column>");
1288                    sb.append(
1289                            "<column><column-name>layoutUuid</column-name><column-value><![CDATA[");
1290                    sb.append(getLayoutUuid());
1291                    sb.append("]]></column-value></column>");
1292                    sb.append(
1293                            "<column><column-name>height</column-name><column-value><![CDATA[");
1294                    sb.append(getHeight());
1295                    sb.append("]]></column-value></column>");
1296                    sb.append(
1297                            "<column><column-name>width</column-name><column-value><![CDATA[");
1298                    sb.append(getWidth());
1299                    sb.append("]]></column-value></column>");
1300                    sb.append(
1301                            "<column><column-name>priority</column-name><column-value><![CDATA[");
1302                    sb.append(getPriority());
1303                    sb.append("]]></column-value></column>");
1304                    sb.append(
1305                            "<column><column-name>viewCount</column-name><column-value><![CDATA[");
1306                    sb.append(getViewCount());
1307                    sb.append("]]></column-value></column>");
1308    
1309                    sb.append("</model>");
1310    
1311                    return sb.toString();
1312            }
1313    
1314            private static ClassLoader _classLoader = AssetEntry.class.getClassLoader();
1315            private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
1316                            AssetEntry.class
1317                    };
1318            private long _entryId;
1319            private long _groupId;
1320            private long _originalGroupId;
1321            private boolean _setOriginalGroupId;
1322            private long _companyId;
1323            private long _originalCompanyId;
1324            private boolean _setOriginalCompanyId;
1325            private long _userId;
1326            private String _userUuid;
1327            private String _userName;
1328            private Date _createDate;
1329            private Date _modifiedDate;
1330            private long _classNameId;
1331            private long _originalClassNameId;
1332            private boolean _setOriginalClassNameId;
1333            private long _classPK;
1334            private long _originalClassPK;
1335            private boolean _setOriginalClassPK;
1336            private String _classUuid;
1337            private String _originalClassUuid;
1338            private long _classTypeId;
1339            private boolean _visible;
1340            private boolean _originalVisible;
1341            private boolean _setOriginalVisible;
1342            private Date _startDate;
1343            private Date _endDate;
1344            private Date _publishDate;
1345            private Date _originalPublishDate;
1346            private Date _expirationDate;
1347            private Date _originalExpirationDate;
1348            private String _mimeType;
1349            private String _title;
1350            private String _titleCurrentLanguageId;
1351            private String _description;
1352            private String _descriptionCurrentLanguageId;
1353            private String _summary;
1354            private String _summaryCurrentLanguageId;
1355            private String _url;
1356            private String _layoutUuid;
1357            private int _height;
1358            private int _width;
1359            private double _priority;
1360            private int _viewCount;
1361            private transient ExpandoBridge _expandoBridge;
1362            private long _columnBitmask;
1363            private AssetEntry _escapedModelProxy;
1364    }