001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.LocaleException;
020    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
021    import com.liferay.portal.kernel.exception.PortalException;
022    import com.liferay.portal.kernel.json.JSON;
023    import com.liferay.portal.kernel.util.GetterUtil;
024    import com.liferay.portal.kernel.util.LocaleUtil;
025    import com.liferay.portal.kernel.util.LocalizationUtil;
026    import com.liferay.portal.kernel.util.ProxyUtil;
027    import com.liferay.portal.kernel.util.StringBundler;
028    import com.liferay.portal.kernel.util.StringPool;
029    import com.liferay.portal.kernel.util.Validator;
030    import com.liferay.portal.model.CacheModel;
031    import com.liferay.portal.model.User;
032    import com.liferay.portal.model.impl.BaseModelImpl;
033    import com.liferay.portal.service.ServiceContext;
034    import com.liferay.portal.service.UserLocalServiceUtil;
035    import com.liferay.portal.util.PortalUtil;
036    
037    import com.liferay.portlet.asset.model.AssetEntry;
038    import com.liferay.portlet.asset.model.AssetEntryModel;
039    import com.liferay.portlet.asset.model.AssetEntrySoap;
040    import com.liferay.portlet.expando.model.ExpandoBridge;
041    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
042    
043    import java.io.Serializable;
044    
045    import java.sql.Types;
046    
047    import java.util.ArrayList;
048    import java.util.Date;
049    import java.util.HashMap;
050    import java.util.List;
051    import java.util.Locale;
052    import java.util.Map;
053    import java.util.Set;
054    import java.util.TreeSet;
055    
056    /**
057     * 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.
058     *
059     * <p>
060     * 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}.
061     * </p>
062     *
063     * @author Brian Wing Shun Chan
064     * @see AssetEntryImpl
065     * @see com.liferay.portlet.asset.model.AssetEntry
066     * @see com.liferay.portlet.asset.model.AssetEntryModel
067     * @generated
068     */
069    @JSON(strict = true)
070    @ProviderType
071    public class AssetEntryModelImpl extends BaseModelImpl<AssetEntry>
072            implements AssetEntryModel {
073            /*
074             * NOTE FOR DEVELOPERS:
075             *
076             * 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.
077             */
078            public static final String TABLE_NAME = "AssetEntry";
079            public static final Object[][] TABLE_COLUMNS = {
080                            { "entryId", Types.BIGINT },
081                            { "groupId", Types.BIGINT },
082                            { "companyId", Types.BIGINT },
083                            { "userId", Types.BIGINT },
084                            { "userName", Types.VARCHAR },
085                            { "createDate", Types.TIMESTAMP },
086                            { "modifiedDate", Types.TIMESTAMP },
087                            { "classNameId", Types.BIGINT },
088                            { "classPK", Types.BIGINT },
089                            { "classUuid", Types.VARCHAR },
090                            { "classTypeId", Types.BIGINT },
091                            { "visible", Types.BOOLEAN },
092                            { "startDate", Types.TIMESTAMP },
093                            { "endDate", Types.TIMESTAMP },
094                            { "publishDate", Types.TIMESTAMP },
095                            { "expirationDate", Types.TIMESTAMP },
096                            { "mimeType", Types.VARCHAR },
097                            { "title", Types.VARCHAR },
098                            { "description", Types.CLOB },
099                            { "summary", Types.CLOB },
100                            { "url", Types.VARCHAR },
101                            { "layoutUuid", Types.VARCHAR },
102                            { "height", Types.INTEGER },
103                            { "width", Types.INTEGER },
104                            { "priority", Types.DOUBLE },
105                            { "viewCount", Types.INTEGER }
106                    };
107            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 TEXT null,summary TEXT null,url STRING null,layoutUuid VARCHAR(75) null,height INTEGER,width INTEGER,priority DOUBLE,viewCount INTEGER)";
108            public static final String TABLE_SQL_DROP = "drop table AssetEntry";
109            public static final String ORDER_BY_JPQL = " ORDER BY assetEntry.entryId ASC";
110            public static final String ORDER_BY_SQL = " ORDER BY AssetEntry.entryId ASC";
111            public static final String DATA_SOURCE = "liferayDataSource";
112            public static final String SESSION_FACTORY = "liferaySessionFactory";
113            public static final String TX_MANAGER = "liferayTransactionManager";
114            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
115                                    "value.object.entity.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
116                            true);
117            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
118                                    "value.object.finder.cache.enabled.com.liferay.portlet.asset.model.AssetEntry"),
119                            true);
120            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
121                                    "value.object.column.bitmask.enabled.com.liferay.portlet.asset.model.AssetEntry"),
122                            true);
123            public static final long CLASSNAMEID_COLUMN_BITMASK = 1L;
124            public static final long CLASSPK_COLUMN_BITMASK = 2L;
125            public static final long CLASSUUID_COLUMN_BITMASK = 4L;
126            public static final long COMPANYID_COLUMN_BITMASK = 8L;
127            public static final long EXPIRATIONDATE_COLUMN_BITMASK = 16L;
128            public static final long GROUPID_COLUMN_BITMASK = 32L;
129            public static final long LAYOUTUUID_COLUMN_BITMASK = 64L;
130            public static final long PUBLISHDATE_COLUMN_BITMASK = 128L;
131            public static final long VISIBLE_COLUMN_BITMASK = 256L;
132            public static final long ENTRYID_COLUMN_BITMASK = 512L;
133    
134            /**
135             * Converts the soap model instance into a normal model instance.
136             *
137             * @param soapModel the soap model instance to convert
138             * @return the normal model instance
139             */
140            public static AssetEntry toModel(AssetEntrySoap soapModel) {
141                    if (soapModel == null) {
142                            return null;
143                    }
144    
145                    AssetEntry model = new AssetEntryImpl();
146    
147                    model.setEntryId(soapModel.getEntryId());
148                    model.setGroupId(soapModel.getGroupId());
149                    model.setCompanyId(soapModel.getCompanyId());
150                    model.setUserId(soapModel.getUserId());
151                    model.setUserName(soapModel.getUserName());
152                    model.setCreateDate(soapModel.getCreateDate());
153                    model.setModifiedDate(soapModel.getModifiedDate());
154                    model.setClassNameId(soapModel.getClassNameId());
155                    model.setClassPK(soapModel.getClassPK());
156                    model.setClassUuid(soapModel.getClassUuid());
157                    model.setClassTypeId(soapModel.getClassTypeId());
158                    model.setVisible(soapModel.getVisible());
159                    model.setStartDate(soapModel.getStartDate());
160                    model.setEndDate(soapModel.getEndDate());
161                    model.setPublishDate(soapModel.getPublishDate());
162                    model.setExpirationDate(soapModel.getExpirationDate());
163                    model.setMimeType(soapModel.getMimeType());
164                    model.setTitle(soapModel.getTitle());
165                    model.setDescription(soapModel.getDescription());
166                    model.setSummary(soapModel.getSummary());
167                    model.setUrl(soapModel.getUrl());
168                    model.setLayoutUuid(soapModel.getLayoutUuid());
169                    model.setHeight(soapModel.getHeight());
170                    model.setWidth(soapModel.getWidth());
171                    model.setPriority(soapModel.getPriority());
172                    model.setViewCount(soapModel.getViewCount());
173    
174                    return model;
175            }
176    
177            /**
178             * Converts the soap model instances into normal model instances.
179             *
180             * @param soapModels the soap model instances to convert
181             * @return the normal model instances
182             */
183            public static List<AssetEntry> toModels(AssetEntrySoap[] soapModels) {
184                    if (soapModels == null) {
185                            return null;
186                    }
187    
188                    List<AssetEntry> models = new ArrayList<AssetEntry>(soapModels.length);
189    
190                    for (AssetEntrySoap soapModel : soapModels) {
191                            models.add(toModel(soapModel));
192                    }
193    
194                    return models;
195            }
196    
197            public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_NAME = "AssetEntries_AssetCategories";
198            public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_COLUMNS =
199                    {
200                            { "categoryId", Types.BIGINT },
201                            { "entryId", Types.BIGINT }
202                    };
203            public static final String MAPPING_TABLE_ASSETENTRIES_ASSETCATEGORIES_SQL_CREATE =
204                    "create table AssetEntries_AssetCategories (categoryId LONG not null,entryId LONG not null,primary key (categoryId, entryId))";
205            public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETCATEGORIES =
206                    GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
207                                    "value.object.finder.cache.enabled.AssetEntries_AssetCategories"),
208                            true);
209            public static final String MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_NAME = "AssetEntries_AssetTags";
210            public static final Object[][] MAPPING_TABLE_ASSETENTRIES_ASSETTAGS_COLUMNS = {
211                            { "entryId", Types.BIGINT },
212                            { "tagId", Types.BIGINT }
213                    };
214            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))";
215            public static final boolean FINDER_CACHE_ENABLED_ASSETENTRIES_ASSETTAGS = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
216                                    "value.object.finder.cache.enabled.AssetEntries_AssetTags"),
217                            true);
218            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
219                                    "lock.expiration.time.com.liferay.portlet.asset.model.AssetEntry"));
220    
221            public AssetEntryModelImpl() {
222            }
223    
224            @Override
225            public long getPrimaryKey() {
226                    return _entryId;
227            }
228    
229            @Override
230            public void setPrimaryKey(long primaryKey) {
231                    setEntryId(primaryKey);
232            }
233    
234            @Override
235            public Serializable getPrimaryKeyObj() {
236                    return _entryId;
237            }
238    
239            @Override
240            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
241                    setPrimaryKey(((Long)primaryKeyObj).longValue());
242            }
243    
244            @Override
245            public Class<?> getModelClass() {
246                    return AssetEntry.class;
247            }
248    
249            @Override
250            public String getModelClassName() {
251                    return AssetEntry.class.getName();
252            }
253    
254            @Override
255            public Map<String, Object> getModelAttributes() {
256                    Map<String, Object> attributes = new HashMap<String, Object>();
257    
258                    attributes.put("entryId", getEntryId());
259                    attributes.put("groupId", getGroupId());
260                    attributes.put("companyId", getCompanyId());
261                    attributes.put("userId", getUserId());
262                    attributes.put("userName", getUserName());
263                    attributes.put("createDate", getCreateDate());
264                    attributes.put("modifiedDate", getModifiedDate());
265                    attributes.put("classNameId", getClassNameId());
266                    attributes.put("classPK", getClassPK());
267                    attributes.put("classUuid", getClassUuid());
268                    attributes.put("classTypeId", getClassTypeId());
269                    attributes.put("visible", getVisible());
270                    attributes.put("startDate", getStartDate());
271                    attributes.put("endDate", getEndDate());
272                    attributes.put("publishDate", getPublishDate());
273                    attributes.put("expirationDate", getExpirationDate());
274                    attributes.put("mimeType", getMimeType());
275                    attributes.put("title", getTitle());
276                    attributes.put("description", getDescription());
277                    attributes.put("summary", getSummary());
278                    attributes.put("url", getUrl());
279                    attributes.put("layoutUuid", getLayoutUuid());
280                    attributes.put("height", getHeight());
281                    attributes.put("width", getWidth());
282                    attributes.put("priority", getPriority());
283                    attributes.put("viewCount", getViewCount());
284    
285                    attributes.put("entityCacheEnabled", isEntityCacheEnabled());
286                    attributes.put("finderCacheEnabled", isFinderCacheEnabled());
287    
288                    return attributes;
289            }
290    
291            @Override
292            public void setModelAttributes(Map<String, Object> attributes) {
293                    Long entryId = (Long)attributes.get("entryId");
294    
295                    if (entryId != null) {
296                            setEntryId(entryId);
297                    }
298    
299                    Long groupId = (Long)attributes.get("groupId");
300    
301                    if (groupId != null) {
302                            setGroupId(groupId);
303                    }
304    
305                    Long companyId = (Long)attributes.get("companyId");
306    
307                    if (companyId != null) {
308                            setCompanyId(companyId);
309                    }
310    
311                    Long userId = (Long)attributes.get("userId");
312    
313                    if (userId != null) {
314                            setUserId(userId);
315                    }
316    
317                    String userName = (String)attributes.get("userName");
318    
319                    if (userName != null) {
320                            setUserName(userName);
321                    }
322    
323                    Date createDate = (Date)attributes.get("createDate");
324    
325                    if (createDate != null) {
326                            setCreateDate(createDate);
327                    }
328    
329                    Date modifiedDate = (Date)attributes.get("modifiedDate");
330    
331                    if (modifiedDate != null) {
332                            setModifiedDate(modifiedDate);
333                    }
334    
335                    Long classNameId = (Long)attributes.get("classNameId");
336    
337                    if (classNameId != null) {
338                            setClassNameId(classNameId);
339                    }
340    
341                    Long classPK = (Long)attributes.get("classPK");
342    
343                    if (classPK != null) {
344                            setClassPK(classPK);
345                    }
346    
347                    String classUuid = (String)attributes.get("classUuid");
348    
349                    if (classUuid != null) {
350                            setClassUuid(classUuid);
351                    }
352    
353                    Long classTypeId = (Long)attributes.get("classTypeId");
354    
355                    if (classTypeId != null) {
356                            setClassTypeId(classTypeId);
357                    }
358    
359                    Boolean visible = (Boolean)attributes.get("visible");
360    
361                    if (visible != null) {
362                            setVisible(visible);
363                    }
364    
365                    Date startDate = (Date)attributes.get("startDate");
366    
367                    if (startDate != null) {
368                            setStartDate(startDate);
369                    }
370    
371                    Date endDate = (Date)attributes.get("endDate");
372    
373                    if (endDate != null) {
374                            setEndDate(endDate);
375                    }
376    
377                    Date publishDate = (Date)attributes.get("publishDate");
378    
379                    if (publishDate != null) {
380                            setPublishDate(publishDate);
381                    }
382    
383                    Date expirationDate = (Date)attributes.get("expirationDate");
384    
385                    if (expirationDate != null) {
386                            setExpirationDate(expirationDate);
387                    }
388    
389                    String mimeType = (String)attributes.get("mimeType");
390    
391                    if (mimeType != null) {
392                            setMimeType(mimeType);
393                    }
394    
395                    String title = (String)attributes.get("title");
396    
397                    if (title != null) {
398                            setTitle(title);
399                    }
400    
401                    String description = (String)attributes.get("description");
402    
403                    if (description != null) {
404                            setDescription(description);
405                    }
406    
407                    String summary = (String)attributes.get("summary");
408    
409                    if (summary != null) {
410                            setSummary(summary);
411                    }
412    
413                    String url = (String)attributes.get("url");
414    
415                    if (url != null) {
416                            setUrl(url);
417                    }
418    
419                    String layoutUuid = (String)attributes.get("layoutUuid");
420    
421                    if (layoutUuid != null) {
422                            setLayoutUuid(layoutUuid);
423                    }
424    
425                    Integer height = (Integer)attributes.get("height");
426    
427                    if (height != null) {
428                            setHeight(height);
429                    }
430    
431                    Integer width = (Integer)attributes.get("width");
432    
433                    if (width != null) {
434                            setWidth(width);
435                    }
436    
437                    Double priority = (Double)attributes.get("priority");
438    
439                    if (priority != null) {
440                            setPriority(priority);
441                    }
442    
443                    Integer viewCount = (Integer)attributes.get("viewCount");
444    
445                    if (viewCount != null) {
446                            setViewCount(viewCount);
447                    }
448            }
449    
450            @JSON
451            @Override
452            public long getEntryId() {
453                    return _entryId;
454            }
455    
456            @Override
457            public void setEntryId(long entryId) {
458                    _entryId = entryId;
459            }
460    
461            @JSON
462            @Override
463            public long getGroupId() {
464                    return _groupId;
465            }
466    
467            @Override
468            public void setGroupId(long groupId) {
469                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
470    
471                    if (!_setOriginalGroupId) {
472                            _setOriginalGroupId = true;
473    
474                            _originalGroupId = _groupId;
475                    }
476    
477                    _groupId = groupId;
478            }
479    
480            public long getOriginalGroupId() {
481                    return _originalGroupId;
482            }
483    
484            @JSON
485            @Override
486            public long getCompanyId() {
487                    return _companyId;
488            }
489    
490            @Override
491            public void setCompanyId(long companyId) {
492                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
493    
494                    if (!_setOriginalCompanyId) {
495                            _setOriginalCompanyId = true;
496    
497                            _originalCompanyId = _companyId;
498                    }
499    
500                    _companyId = companyId;
501            }
502    
503            public long getOriginalCompanyId() {
504                    return _originalCompanyId;
505            }
506    
507            @JSON
508            @Override
509            public long getUserId() {
510                    return _userId;
511            }
512    
513            @Override
514            public void setUserId(long userId) {
515                    _userId = userId;
516            }
517    
518            @Override
519            public String getUserUuid() {
520                    try {
521                            User user = UserLocalServiceUtil.getUserById(getUserId());
522    
523                            return user.getUuid();
524                    }
525                    catch (PortalException pe) {
526                            return StringPool.BLANK;
527                    }
528            }
529    
530            @Override
531            public void setUserUuid(String userUuid) {
532            }
533    
534            @JSON
535            @Override
536            public String getUserName() {
537                    if (_userName == null) {
538                            return StringPool.BLANK;
539                    }
540                    else {
541                            return _userName;
542                    }
543            }
544    
545            @Override
546            public void setUserName(String userName) {
547                    _userName = userName;
548            }
549    
550            @JSON
551            @Override
552            public Date getCreateDate() {
553                    return _createDate;
554            }
555    
556            @Override
557            public void setCreateDate(Date createDate) {
558                    _createDate = createDate;
559            }
560    
561            @JSON
562            @Override
563            public Date getModifiedDate() {
564                    return _modifiedDate;
565            }
566    
567            @Override
568            public void setModifiedDate(Date modifiedDate) {
569                    _modifiedDate = modifiedDate;
570            }
571    
572            @Override
573            public String getClassName() {
574                    if (getClassNameId() <= 0) {
575                            return StringPool.BLANK;
576                    }
577    
578                    return PortalUtil.getClassName(getClassNameId());
579            }
580    
581            @Override
582            public void setClassName(String className) {
583                    long classNameId = 0;
584    
585                    if (Validator.isNotNull(className)) {
586                            classNameId = PortalUtil.getClassNameId(className);
587                    }
588    
589                    setClassNameId(classNameId);
590            }
591    
592            @JSON
593            @Override
594            public long getClassNameId() {
595                    return _classNameId;
596            }
597    
598            @Override
599            public void setClassNameId(long classNameId) {
600                    _columnBitmask |= CLASSNAMEID_COLUMN_BITMASK;
601    
602                    if (!_setOriginalClassNameId) {
603                            _setOriginalClassNameId = true;
604    
605                            _originalClassNameId = _classNameId;
606                    }
607    
608                    _classNameId = classNameId;
609            }
610    
611            public long getOriginalClassNameId() {
612                    return _originalClassNameId;
613            }
614    
615            @JSON
616            @Override
617            public long getClassPK() {
618                    return _classPK;
619            }
620    
621            @Override
622            public void setClassPK(long classPK) {
623                    _columnBitmask |= CLASSPK_COLUMN_BITMASK;
624    
625                    if (!_setOriginalClassPK) {
626                            _setOriginalClassPK = true;
627    
628                            _originalClassPK = _classPK;
629                    }
630    
631                    _classPK = classPK;
632            }
633    
634            public long getOriginalClassPK() {
635                    return _originalClassPK;
636            }
637    
638            @JSON
639            @Override
640            public String getClassUuid() {
641                    if (_classUuid == null) {
642                            return StringPool.BLANK;
643                    }
644                    else {
645                            return _classUuid;
646                    }
647            }
648    
649            @Override
650            public void setClassUuid(String classUuid) {
651                    _columnBitmask |= CLASSUUID_COLUMN_BITMASK;
652    
653                    if (_originalClassUuid == null) {
654                            _originalClassUuid = _classUuid;
655                    }
656    
657                    _classUuid = classUuid;
658            }
659    
660            public String getOriginalClassUuid() {
661                    return GetterUtil.getString(_originalClassUuid);
662            }
663    
664            @JSON
665            @Override
666            public long getClassTypeId() {
667                    return _classTypeId;
668            }
669    
670            @Override
671            public void setClassTypeId(long classTypeId) {
672                    _classTypeId = classTypeId;
673            }
674    
675            @JSON
676            @Override
677            public boolean getVisible() {
678                    return _visible;
679            }
680    
681            @Override
682            public boolean isVisible() {
683                    return _visible;
684            }
685    
686            @Override
687            public void setVisible(boolean visible) {
688                    _columnBitmask |= VISIBLE_COLUMN_BITMASK;
689    
690                    if (!_setOriginalVisible) {
691                            _setOriginalVisible = true;
692    
693                            _originalVisible = _visible;
694                    }
695    
696                    _visible = visible;
697            }
698    
699            public boolean getOriginalVisible() {
700                    return _originalVisible;
701            }
702    
703            @JSON
704            @Override
705            public Date getStartDate() {
706                    return _startDate;
707            }
708    
709            @Override
710            public void setStartDate(Date startDate) {
711                    _startDate = startDate;
712            }
713    
714            @JSON
715            @Override
716            public Date getEndDate() {
717                    return _endDate;
718            }
719    
720            @Override
721            public void setEndDate(Date endDate) {
722                    _endDate = endDate;
723            }
724    
725            @JSON
726            @Override
727            public Date getPublishDate() {
728                    return _publishDate;
729            }
730    
731            @Override
732            public void setPublishDate(Date publishDate) {
733                    _columnBitmask |= PUBLISHDATE_COLUMN_BITMASK;
734    
735                    if (_originalPublishDate == null) {
736                            _originalPublishDate = _publishDate;
737                    }
738    
739                    _publishDate = publishDate;
740            }
741    
742            public Date getOriginalPublishDate() {
743                    return _originalPublishDate;
744            }
745    
746            @JSON
747            @Override
748            public Date getExpirationDate() {
749                    return _expirationDate;
750            }
751    
752            @Override
753            public void setExpirationDate(Date expirationDate) {
754                    _columnBitmask |= EXPIRATIONDATE_COLUMN_BITMASK;
755    
756                    if (_originalExpirationDate == null) {
757                            _originalExpirationDate = _expirationDate;
758                    }
759    
760                    _expirationDate = expirationDate;
761            }
762    
763            public Date getOriginalExpirationDate() {
764                    return _originalExpirationDate;
765            }
766    
767            @JSON
768            @Override
769            public String getMimeType() {
770                    if (_mimeType == null) {
771                            return StringPool.BLANK;
772                    }
773                    else {
774                            return _mimeType;
775                    }
776            }
777    
778            @Override
779            public void setMimeType(String mimeType) {
780                    _mimeType = mimeType;
781            }
782    
783            @JSON
784            @Override
785            public String getTitle() {
786                    if (_title == null) {
787                            return StringPool.BLANK;
788                    }
789                    else {
790                            return _title;
791                    }
792            }
793    
794            @Override
795            public String getTitle(Locale locale) {
796                    String languageId = LocaleUtil.toLanguageId(locale);
797    
798                    return getTitle(languageId);
799            }
800    
801            @Override
802            public String getTitle(Locale locale, boolean useDefault) {
803                    String languageId = LocaleUtil.toLanguageId(locale);
804    
805                    return getTitle(languageId, useDefault);
806            }
807    
808            @Override
809            public String getTitle(String languageId) {
810                    return LocalizationUtil.getLocalization(getTitle(), languageId);
811            }
812    
813            @Override
814            public String getTitle(String languageId, boolean useDefault) {
815                    return LocalizationUtil.getLocalization(getTitle(), languageId,
816                            useDefault);
817            }
818    
819            @Override
820            public String getTitleCurrentLanguageId() {
821                    return _titleCurrentLanguageId;
822            }
823    
824            @JSON
825            @Override
826            public String getTitleCurrentValue() {
827                    Locale locale = getLocale(_titleCurrentLanguageId);
828    
829                    return getTitle(locale);
830            }
831    
832            @Override
833            public Map<Locale, String> getTitleMap() {
834                    return LocalizationUtil.getLocalizationMap(getTitle());
835            }
836    
837            @Override
838            public void setTitle(String title) {
839                    _title = title;
840            }
841    
842            @Override
843            public void setTitle(String title, Locale locale) {
844                    setTitle(title, locale, LocaleUtil.getSiteDefault());
845            }
846    
847            @Override
848            public void setTitle(String title, Locale locale, Locale defaultLocale) {
849                    String languageId = LocaleUtil.toLanguageId(locale);
850                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
851    
852                    if (Validator.isNotNull(title)) {
853                            setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
854                                            title, languageId, defaultLanguageId));
855                    }
856                    else {
857                            setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
858                                            languageId));
859                    }
860            }
861    
862            @Override
863            public void setTitleCurrentLanguageId(String languageId) {
864                    _titleCurrentLanguageId = languageId;
865            }
866    
867            @Override
868            public void setTitleMap(Map<Locale, String> titleMap) {
869                    setTitleMap(titleMap, LocaleUtil.getSiteDefault());
870            }
871    
872            @Override
873            public void setTitleMap(Map<Locale, String> titleMap, Locale defaultLocale) {
874                    if (titleMap == null) {
875                            return;
876                    }
877    
878                    setTitle(LocalizationUtil.updateLocalization(titleMap, getTitle(),
879                                    "Title", LocaleUtil.toLanguageId(defaultLocale)));
880            }
881    
882            @JSON
883            @Override
884            public String getDescription() {
885                    if (_description == null) {
886                            return StringPool.BLANK;
887                    }
888                    else {
889                            return _description;
890                    }
891            }
892    
893            @Override
894            public String getDescription(Locale locale) {
895                    String languageId = LocaleUtil.toLanguageId(locale);
896    
897                    return getDescription(languageId);
898            }
899    
900            @Override
901            public String getDescription(Locale locale, boolean useDefault) {
902                    String languageId = LocaleUtil.toLanguageId(locale);
903    
904                    return getDescription(languageId, useDefault);
905            }
906    
907            @Override
908            public String getDescription(String languageId) {
909                    return LocalizationUtil.getLocalization(getDescription(), languageId);
910            }
911    
912            @Override
913            public String getDescription(String languageId, boolean useDefault) {
914                    return LocalizationUtil.getLocalization(getDescription(), languageId,
915                            useDefault);
916            }
917    
918            @Override
919            public String getDescriptionCurrentLanguageId() {
920                    return _descriptionCurrentLanguageId;
921            }
922    
923            @JSON
924            @Override
925            public String getDescriptionCurrentValue() {
926                    Locale locale = getLocale(_descriptionCurrentLanguageId);
927    
928                    return getDescription(locale);
929            }
930    
931            @Override
932            public Map<Locale, String> getDescriptionMap() {
933                    return LocalizationUtil.getLocalizationMap(getDescription());
934            }
935    
936            @Override
937            public void setDescription(String description) {
938                    _description = description;
939            }
940    
941            @Override
942            public void setDescription(String description, Locale locale) {
943                    setDescription(description, locale, LocaleUtil.getSiteDefault());
944            }
945    
946            @Override
947            public void setDescription(String description, Locale locale,
948                    Locale defaultLocale) {
949                    String languageId = LocaleUtil.toLanguageId(locale);
950                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
951    
952                    if (Validator.isNotNull(description)) {
953                            setDescription(LocalizationUtil.updateLocalization(
954                                            getDescription(), "Description", description, languageId,
955                                            defaultLanguageId));
956                    }
957                    else {
958                            setDescription(LocalizationUtil.removeLocalization(
959                                            getDescription(), "Description", languageId));
960                    }
961            }
962    
963            @Override
964            public void setDescriptionCurrentLanguageId(String languageId) {
965                    _descriptionCurrentLanguageId = languageId;
966            }
967    
968            @Override
969            public void setDescriptionMap(Map<Locale, String> descriptionMap) {
970                    setDescriptionMap(descriptionMap, LocaleUtil.getSiteDefault());
971            }
972    
973            @Override
974            public void setDescriptionMap(Map<Locale, String> descriptionMap,
975                    Locale defaultLocale) {
976                    if (descriptionMap == null) {
977                            return;
978                    }
979    
980                    setDescription(LocalizationUtil.updateLocalization(descriptionMap,
981                                    getDescription(), "Description",
982                                    LocaleUtil.toLanguageId(defaultLocale)));
983            }
984    
985            @JSON
986            @Override
987            public String getSummary() {
988                    if (_summary == null) {
989                            return StringPool.BLANK;
990                    }
991                    else {
992                            return _summary;
993                    }
994            }
995    
996            @Override
997            public String getSummary(Locale locale) {
998                    String languageId = LocaleUtil.toLanguageId(locale);
999    
1000                    return getSummary(languageId);
1001            }
1002    
1003            @Override
1004            public String getSummary(Locale locale, boolean useDefault) {
1005                    String languageId = LocaleUtil.toLanguageId(locale);
1006    
1007                    return getSummary(languageId, useDefault);
1008            }
1009    
1010            @Override
1011            public String getSummary(String languageId) {
1012                    return LocalizationUtil.getLocalization(getSummary(), languageId);
1013            }
1014    
1015            @Override
1016            public String getSummary(String languageId, boolean useDefault) {
1017                    return LocalizationUtil.getLocalization(getSummary(), languageId,
1018                            useDefault);
1019            }
1020    
1021            @Override
1022            public String getSummaryCurrentLanguageId() {
1023                    return _summaryCurrentLanguageId;
1024            }
1025    
1026            @JSON
1027            @Override
1028            public String getSummaryCurrentValue() {
1029                    Locale locale = getLocale(_summaryCurrentLanguageId);
1030    
1031                    return getSummary(locale);
1032            }
1033    
1034            @Override
1035            public Map<Locale, String> getSummaryMap() {
1036                    return LocalizationUtil.getLocalizationMap(getSummary());
1037            }
1038    
1039            @Override
1040            public void setSummary(String summary) {
1041                    _summary = summary;
1042            }
1043    
1044            @Override
1045            public void setSummary(String summary, Locale locale) {
1046                    setSummary(summary, locale, LocaleUtil.getSiteDefault());
1047            }
1048    
1049            @Override
1050            public void setSummary(String summary, Locale locale, Locale defaultLocale) {
1051                    String languageId = LocaleUtil.toLanguageId(locale);
1052                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
1053    
1054                    if (Validator.isNotNull(summary)) {
1055                            setSummary(LocalizationUtil.updateLocalization(getSummary(),
1056                                            "Summary", summary, languageId, defaultLanguageId));
1057                    }
1058                    else {
1059                            setSummary(LocalizationUtil.removeLocalization(getSummary(),
1060                                            "Summary", languageId));
1061                    }
1062            }
1063    
1064            @Override
1065            public void setSummaryCurrentLanguageId(String languageId) {
1066                    _summaryCurrentLanguageId = languageId;
1067            }
1068    
1069            @Override
1070            public void setSummaryMap(Map<Locale, String> summaryMap) {
1071                    setSummaryMap(summaryMap, LocaleUtil.getSiteDefault());
1072            }
1073    
1074            @Override
1075            public void setSummaryMap(Map<Locale, String> summaryMap,
1076                    Locale defaultLocale) {
1077                    if (summaryMap == null) {
1078                            return;
1079                    }
1080    
1081                    setSummary(LocalizationUtil.updateLocalization(summaryMap,
1082                                    getSummary(), "Summary", LocaleUtil.toLanguageId(defaultLocale)));
1083            }
1084    
1085            @JSON
1086            @Override
1087            public String getUrl() {
1088                    if (_url == null) {
1089                            return StringPool.BLANK;
1090                    }
1091                    else {
1092                            return _url;
1093                    }
1094            }
1095    
1096            @Override
1097            public void setUrl(String url) {
1098                    _url = url;
1099            }
1100    
1101            @JSON
1102            @Override
1103            public String getLayoutUuid() {
1104                    if (_layoutUuid == null) {
1105                            return StringPool.BLANK;
1106                    }
1107                    else {
1108                            return _layoutUuid;
1109                    }
1110            }
1111    
1112            @Override
1113            public void setLayoutUuid(String layoutUuid) {
1114                    _columnBitmask |= LAYOUTUUID_COLUMN_BITMASK;
1115    
1116                    if (_originalLayoutUuid == null) {
1117                            _originalLayoutUuid = _layoutUuid;
1118                    }
1119    
1120                    _layoutUuid = layoutUuid;
1121            }
1122    
1123            public String getOriginalLayoutUuid() {
1124                    return GetterUtil.getString(_originalLayoutUuid);
1125            }
1126    
1127            @JSON
1128            @Override
1129            public int getHeight() {
1130                    return _height;
1131            }
1132    
1133            @Override
1134            public void setHeight(int height) {
1135                    _height = height;
1136            }
1137    
1138            @JSON
1139            @Override
1140            public int getWidth() {
1141                    return _width;
1142            }
1143    
1144            @Override
1145            public void setWidth(int width) {
1146                    _width = width;
1147            }
1148    
1149            @JSON
1150            @Override
1151            public double getPriority() {
1152                    return _priority;
1153            }
1154    
1155            @Override
1156            public void setPriority(double priority) {
1157                    _priority = priority;
1158            }
1159    
1160            @JSON
1161            @Override
1162            public int getViewCount() {
1163                    return _viewCount;
1164            }
1165    
1166            @Override
1167            public void setViewCount(int viewCount) {
1168                    _viewCount = viewCount;
1169            }
1170    
1171            public long getColumnBitmask() {
1172                    return _columnBitmask;
1173            }
1174    
1175            @Override
1176            public ExpandoBridge getExpandoBridge() {
1177                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
1178                            AssetEntry.class.getName(), getPrimaryKey());
1179            }
1180    
1181            @Override
1182            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
1183                    ExpandoBridge expandoBridge = getExpandoBridge();
1184    
1185                    expandoBridge.setAttributes(serviceContext);
1186            }
1187    
1188            @Override
1189            public String[] getAvailableLanguageIds() {
1190                    Set<String> availableLanguageIds = new TreeSet<String>();
1191    
1192                    Map<Locale, String> titleMap = getTitleMap();
1193    
1194                    for (Map.Entry<Locale, String> entry : titleMap.entrySet()) {
1195                            Locale locale = entry.getKey();
1196                            String value = entry.getValue();
1197    
1198                            if (Validator.isNotNull(value)) {
1199                                    availableLanguageIds.add(LocaleUtil.toLanguageId(locale));
1200                            }
1201                    }
1202    
1203                    Map<Locale, String> descriptionMap = getDescriptionMap();
1204    
1205                    for (Map.Entry<Locale, String> entry : descriptionMap.entrySet()) {
1206                            Locale locale = entry.getKey();
1207                            String value = entry.getValue();
1208    
1209                            if (Validator.isNotNull(value)) {
1210                                    availableLanguageIds.add(LocaleUtil.toLanguageId(locale));
1211                            }
1212                    }
1213    
1214                    Map<Locale, String> summaryMap = getSummaryMap();
1215    
1216                    for (Map.Entry<Locale, String> entry : summaryMap.entrySet()) {
1217                            Locale locale = entry.getKey();
1218                            String value = entry.getValue();
1219    
1220                            if (Validator.isNotNull(value)) {
1221                                    availableLanguageIds.add(LocaleUtil.toLanguageId(locale));
1222                            }
1223                    }
1224    
1225                    return availableLanguageIds.toArray(new String[availableLanguageIds.size()]);
1226            }
1227    
1228            @Override
1229            public String getDefaultLanguageId() {
1230                    String xml = getTitle();
1231    
1232                    if (xml == null) {
1233                            return StringPool.BLANK;
1234                    }
1235    
1236                    Locale defaultLocale = LocaleUtil.getSiteDefault();
1237    
1238                    return LocalizationUtil.getDefaultLanguageId(xml, defaultLocale);
1239            }
1240    
1241            @Override
1242            public void prepareLocalizedFieldsForImport() throws LocaleException {
1243                    Locale defaultLocale = LocaleUtil.fromLanguageId(getDefaultLanguageId());
1244    
1245                    Locale[] availableLocales = LocaleUtil.fromLanguageIds(getAvailableLanguageIds());
1246    
1247                    Locale defaultImportLocale = LocalizationUtil.getDefaultImportLocale(AssetEntry.class.getName(),
1248                                    getPrimaryKey(), defaultLocale, availableLocales);
1249    
1250                    prepareLocalizedFieldsForImport(defaultImportLocale);
1251            }
1252    
1253            @Override
1254            @SuppressWarnings("unused")
1255            public void prepareLocalizedFieldsForImport(Locale defaultImportLocale)
1256                    throws LocaleException {
1257                    Locale defaultLocale = LocaleUtil.getSiteDefault();
1258    
1259                    String modelDefaultLanguageId = getDefaultLanguageId();
1260    
1261                    String title = getTitle(defaultLocale);
1262    
1263                    if (Validator.isNull(title)) {
1264                            setTitle(getTitle(modelDefaultLanguageId), defaultLocale);
1265                    }
1266                    else {
1267                            setTitle(getTitle(defaultLocale), defaultLocale, defaultLocale);
1268                    }
1269    
1270                    String description = getDescription(defaultLocale);
1271    
1272                    if (Validator.isNull(description)) {
1273                            setDescription(getDescription(modelDefaultLanguageId), defaultLocale);
1274                    }
1275                    else {
1276                            setDescription(getDescription(defaultLocale), defaultLocale,
1277                                    defaultLocale);
1278                    }
1279    
1280                    String summary = getSummary(defaultLocale);
1281    
1282                    if (Validator.isNull(summary)) {
1283                            setSummary(getSummary(modelDefaultLanguageId), defaultLocale);
1284                    }
1285                    else {
1286                            setSummary(getSummary(defaultLocale), defaultLocale, defaultLocale);
1287                    }
1288            }
1289    
1290            @Override
1291            public AssetEntry toEscapedModel() {
1292                    if (_escapedModel == null) {
1293                            _escapedModel = (AssetEntry)ProxyUtil.newProxyInstance(_classLoader,
1294                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
1295                    }
1296    
1297                    return _escapedModel;
1298            }
1299    
1300            @Override
1301            public Object clone() {
1302                    AssetEntryImpl assetEntryImpl = new AssetEntryImpl();
1303    
1304                    assetEntryImpl.setEntryId(getEntryId());
1305                    assetEntryImpl.setGroupId(getGroupId());
1306                    assetEntryImpl.setCompanyId(getCompanyId());
1307                    assetEntryImpl.setUserId(getUserId());
1308                    assetEntryImpl.setUserName(getUserName());
1309                    assetEntryImpl.setCreateDate(getCreateDate());
1310                    assetEntryImpl.setModifiedDate(getModifiedDate());
1311                    assetEntryImpl.setClassNameId(getClassNameId());
1312                    assetEntryImpl.setClassPK(getClassPK());
1313                    assetEntryImpl.setClassUuid(getClassUuid());
1314                    assetEntryImpl.setClassTypeId(getClassTypeId());
1315                    assetEntryImpl.setVisible(getVisible());
1316                    assetEntryImpl.setStartDate(getStartDate());
1317                    assetEntryImpl.setEndDate(getEndDate());
1318                    assetEntryImpl.setPublishDate(getPublishDate());
1319                    assetEntryImpl.setExpirationDate(getExpirationDate());
1320                    assetEntryImpl.setMimeType(getMimeType());
1321                    assetEntryImpl.setTitle(getTitle());
1322                    assetEntryImpl.setDescription(getDescription());
1323                    assetEntryImpl.setSummary(getSummary());
1324                    assetEntryImpl.setUrl(getUrl());
1325                    assetEntryImpl.setLayoutUuid(getLayoutUuid());
1326                    assetEntryImpl.setHeight(getHeight());
1327                    assetEntryImpl.setWidth(getWidth());
1328                    assetEntryImpl.setPriority(getPriority());
1329                    assetEntryImpl.setViewCount(getViewCount());
1330    
1331                    assetEntryImpl.resetOriginalValues();
1332    
1333                    return assetEntryImpl;
1334            }
1335    
1336            @Override
1337            public int compareTo(AssetEntry assetEntry) {
1338                    long primaryKey = assetEntry.getPrimaryKey();
1339    
1340                    if (getPrimaryKey() < primaryKey) {
1341                            return -1;
1342                    }
1343                    else if (getPrimaryKey() > primaryKey) {
1344                            return 1;
1345                    }
1346                    else {
1347                            return 0;
1348                    }
1349            }
1350    
1351            @Override
1352            public boolean equals(Object obj) {
1353                    if (this == obj) {
1354                            return true;
1355                    }
1356    
1357                    if (!(obj instanceof AssetEntry)) {
1358                            return false;
1359                    }
1360    
1361                    AssetEntry assetEntry = (AssetEntry)obj;
1362    
1363                    long primaryKey = assetEntry.getPrimaryKey();
1364    
1365                    if (getPrimaryKey() == primaryKey) {
1366                            return true;
1367                    }
1368                    else {
1369                            return false;
1370                    }
1371            }
1372    
1373            @Override
1374            public int hashCode() {
1375                    return (int)getPrimaryKey();
1376            }
1377    
1378            @Override
1379            public boolean isEntityCacheEnabled() {
1380                    return ENTITY_CACHE_ENABLED;
1381            }
1382    
1383            @Override
1384            public boolean isFinderCacheEnabled() {
1385                    return FINDER_CACHE_ENABLED;
1386            }
1387    
1388            @Override
1389            public void resetOriginalValues() {
1390                    AssetEntryModelImpl assetEntryModelImpl = this;
1391    
1392                    assetEntryModelImpl._originalGroupId = assetEntryModelImpl._groupId;
1393    
1394                    assetEntryModelImpl._setOriginalGroupId = false;
1395    
1396                    assetEntryModelImpl._originalCompanyId = assetEntryModelImpl._companyId;
1397    
1398                    assetEntryModelImpl._setOriginalCompanyId = false;
1399    
1400                    assetEntryModelImpl._originalClassNameId = assetEntryModelImpl._classNameId;
1401    
1402                    assetEntryModelImpl._setOriginalClassNameId = false;
1403    
1404                    assetEntryModelImpl._originalClassPK = assetEntryModelImpl._classPK;
1405    
1406                    assetEntryModelImpl._setOriginalClassPK = false;
1407    
1408                    assetEntryModelImpl._originalClassUuid = assetEntryModelImpl._classUuid;
1409    
1410                    assetEntryModelImpl._originalVisible = assetEntryModelImpl._visible;
1411    
1412                    assetEntryModelImpl._setOriginalVisible = false;
1413    
1414                    assetEntryModelImpl._originalPublishDate = assetEntryModelImpl._publishDate;
1415    
1416                    assetEntryModelImpl._originalExpirationDate = assetEntryModelImpl._expirationDate;
1417    
1418                    assetEntryModelImpl._originalLayoutUuid = assetEntryModelImpl._layoutUuid;
1419    
1420                    assetEntryModelImpl._columnBitmask = 0;
1421            }
1422    
1423            @Override
1424            public CacheModel<AssetEntry> toCacheModel() {
1425                    AssetEntryCacheModel assetEntryCacheModel = new AssetEntryCacheModel();
1426    
1427                    assetEntryCacheModel.entryId = getEntryId();
1428    
1429                    assetEntryCacheModel.groupId = getGroupId();
1430    
1431                    assetEntryCacheModel.companyId = getCompanyId();
1432    
1433                    assetEntryCacheModel.userId = getUserId();
1434    
1435                    assetEntryCacheModel.userName = getUserName();
1436    
1437                    String userName = assetEntryCacheModel.userName;
1438    
1439                    if ((userName != null) && (userName.length() == 0)) {
1440                            assetEntryCacheModel.userName = null;
1441                    }
1442    
1443                    Date createDate = getCreateDate();
1444    
1445                    if (createDate != null) {
1446                            assetEntryCacheModel.createDate = createDate.getTime();
1447                    }
1448                    else {
1449                            assetEntryCacheModel.createDate = Long.MIN_VALUE;
1450                    }
1451    
1452                    Date modifiedDate = getModifiedDate();
1453    
1454                    if (modifiedDate != null) {
1455                            assetEntryCacheModel.modifiedDate = modifiedDate.getTime();
1456                    }
1457                    else {
1458                            assetEntryCacheModel.modifiedDate = Long.MIN_VALUE;
1459                    }
1460    
1461                    assetEntryCacheModel.classNameId = getClassNameId();
1462    
1463                    assetEntryCacheModel.classPK = getClassPK();
1464    
1465                    assetEntryCacheModel.classUuid = getClassUuid();
1466    
1467                    String classUuid = assetEntryCacheModel.classUuid;
1468    
1469                    if ((classUuid != null) && (classUuid.length() == 0)) {
1470                            assetEntryCacheModel.classUuid = null;
1471                    }
1472    
1473                    assetEntryCacheModel.classTypeId = getClassTypeId();
1474    
1475                    assetEntryCacheModel.visible = getVisible();
1476    
1477                    Date startDate = getStartDate();
1478    
1479                    if (startDate != null) {
1480                            assetEntryCacheModel.startDate = startDate.getTime();
1481                    }
1482                    else {
1483                            assetEntryCacheModel.startDate = Long.MIN_VALUE;
1484                    }
1485    
1486                    Date endDate = getEndDate();
1487    
1488                    if (endDate != null) {
1489                            assetEntryCacheModel.endDate = endDate.getTime();
1490                    }
1491                    else {
1492                            assetEntryCacheModel.endDate = Long.MIN_VALUE;
1493                    }
1494    
1495                    Date publishDate = getPublishDate();
1496    
1497                    if (publishDate != null) {
1498                            assetEntryCacheModel.publishDate = publishDate.getTime();
1499                    }
1500                    else {
1501                            assetEntryCacheModel.publishDate = Long.MIN_VALUE;
1502                    }
1503    
1504                    Date expirationDate = getExpirationDate();
1505    
1506                    if (expirationDate != null) {
1507                            assetEntryCacheModel.expirationDate = expirationDate.getTime();
1508                    }
1509                    else {
1510                            assetEntryCacheModel.expirationDate = Long.MIN_VALUE;
1511                    }
1512    
1513                    assetEntryCacheModel.mimeType = getMimeType();
1514    
1515                    String mimeType = assetEntryCacheModel.mimeType;
1516    
1517                    if ((mimeType != null) && (mimeType.length() == 0)) {
1518                            assetEntryCacheModel.mimeType = null;
1519                    }
1520    
1521                    assetEntryCacheModel.title = getTitle();
1522    
1523                    String title = assetEntryCacheModel.title;
1524    
1525                    if ((title != null) && (title.length() == 0)) {
1526                            assetEntryCacheModel.title = null;
1527                    }
1528    
1529                    assetEntryCacheModel.description = getDescription();
1530    
1531                    String description = assetEntryCacheModel.description;
1532    
1533                    if ((description != null) && (description.length() == 0)) {
1534                            assetEntryCacheModel.description = null;
1535                    }
1536    
1537                    assetEntryCacheModel.summary = getSummary();
1538    
1539                    String summary = assetEntryCacheModel.summary;
1540    
1541                    if ((summary != null) && (summary.length() == 0)) {
1542                            assetEntryCacheModel.summary = null;
1543                    }
1544    
1545                    assetEntryCacheModel.url = getUrl();
1546    
1547                    String url = assetEntryCacheModel.url;
1548    
1549                    if ((url != null) && (url.length() == 0)) {
1550                            assetEntryCacheModel.url = null;
1551                    }
1552    
1553                    assetEntryCacheModel.layoutUuid = getLayoutUuid();
1554    
1555                    String layoutUuid = assetEntryCacheModel.layoutUuid;
1556    
1557                    if ((layoutUuid != null) && (layoutUuid.length() == 0)) {
1558                            assetEntryCacheModel.layoutUuid = null;
1559                    }
1560    
1561                    assetEntryCacheModel.height = getHeight();
1562    
1563                    assetEntryCacheModel.width = getWidth();
1564    
1565                    assetEntryCacheModel.priority = getPriority();
1566    
1567                    assetEntryCacheModel.viewCount = getViewCount();
1568    
1569                    return assetEntryCacheModel;
1570            }
1571    
1572            @Override
1573            public String toString() {
1574                    StringBundler sb = new StringBundler(53);
1575    
1576                    sb.append("{entryId=");
1577                    sb.append(getEntryId());
1578                    sb.append(", groupId=");
1579                    sb.append(getGroupId());
1580                    sb.append(", companyId=");
1581                    sb.append(getCompanyId());
1582                    sb.append(", userId=");
1583                    sb.append(getUserId());
1584                    sb.append(", userName=");
1585                    sb.append(getUserName());
1586                    sb.append(", createDate=");
1587                    sb.append(getCreateDate());
1588                    sb.append(", modifiedDate=");
1589                    sb.append(getModifiedDate());
1590                    sb.append(", classNameId=");
1591                    sb.append(getClassNameId());
1592                    sb.append(", classPK=");
1593                    sb.append(getClassPK());
1594                    sb.append(", classUuid=");
1595                    sb.append(getClassUuid());
1596                    sb.append(", classTypeId=");
1597                    sb.append(getClassTypeId());
1598                    sb.append(", visible=");
1599                    sb.append(getVisible());
1600                    sb.append(", startDate=");
1601                    sb.append(getStartDate());
1602                    sb.append(", endDate=");
1603                    sb.append(getEndDate());
1604                    sb.append(", publishDate=");
1605                    sb.append(getPublishDate());
1606                    sb.append(", expirationDate=");
1607                    sb.append(getExpirationDate());
1608                    sb.append(", mimeType=");
1609                    sb.append(getMimeType());
1610                    sb.append(", title=");
1611                    sb.append(getTitle());
1612                    sb.append(", description=");
1613                    sb.append(getDescription());
1614                    sb.append(", summary=");
1615                    sb.append(getSummary());
1616                    sb.append(", url=");
1617                    sb.append(getUrl());
1618                    sb.append(", layoutUuid=");
1619                    sb.append(getLayoutUuid());
1620                    sb.append(", height=");
1621                    sb.append(getHeight());
1622                    sb.append(", width=");
1623                    sb.append(getWidth());
1624                    sb.append(", priority=");
1625                    sb.append(getPriority());
1626                    sb.append(", viewCount=");
1627                    sb.append(getViewCount());
1628                    sb.append("}");
1629    
1630                    return sb.toString();
1631            }
1632    
1633            @Override
1634            public String toXmlString() {
1635                    StringBundler sb = new StringBundler(82);
1636    
1637                    sb.append("<model><model-name>");
1638                    sb.append("com.liferay.portlet.asset.model.AssetEntry");
1639                    sb.append("</model-name>");
1640    
1641                    sb.append(
1642                            "<column><column-name>entryId</column-name><column-value><![CDATA[");
1643                    sb.append(getEntryId());
1644                    sb.append("]]></column-value></column>");
1645                    sb.append(
1646                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
1647                    sb.append(getGroupId());
1648                    sb.append("]]></column-value></column>");
1649                    sb.append(
1650                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
1651                    sb.append(getCompanyId());
1652                    sb.append("]]></column-value></column>");
1653                    sb.append(
1654                            "<column><column-name>userId</column-name><column-value><![CDATA[");
1655                    sb.append(getUserId());
1656                    sb.append("]]></column-value></column>");
1657                    sb.append(
1658                            "<column><column-name>userName</column-name><column-value><![CDATA[");
1659                    sb.append(getUserName());
1660                    sb.append("]]></column-value></column>");
1661                    sb.append(
1662                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
1663                    sb.append(getCreateDate());
1664                    sb.append("]]></column-value></column>");
1665                    sb.append(
1666                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1667                    sb.append(getModifiedDate());
1668                    sb.append("]]></column-value></column>");
1669                    sb.append(
1670                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
1671                    sb.append(getClassNameId());
1672                    sb.append("]]></column-value></column>");
1673                    sb.append(
1674                            "<column><column-name>classPK</column-name><column-value><![CDATA[");
1675                    sb.append(getClassPK());
1676                    sb.append("]]></column-value></column>");
1677                    sb.append(
1678                            "<column><column-name>classUuid</column-name><column-value><![CDATA[");
1679                    sb.append(getClassUuid());
1680                    sb.append("]]></column-value></column>");
1681                    sb.append(
1682                            "<column><column-name>classTypeId</column-name><column-value><![CDATA[");
1683                    sb.append(getClassTypeId());
1684                    sb.append("]]></column-value></column>");
1685                    sb.append(
1686                            "<column><column-name>visible</column-name><column-value><![CDATA[");
1687                    sb.append(getVisible());
1688                    sb.append("]]></column-value></column>");
1689                    sb.append(
1690                            "<column><column-name>startDate</column-name><column-value><![CDATA[");
1691                    sb.append(getStartDate());
1692                    sb.append("]]></column-value></column>");
1693                    sb.append(
1694                            "<column><column-name>endDate</column-name><column-value><![CDATA[");
1695                    sb.append(getEndDate());
1696                    sb.append("]]></column-value></column>");
1697                    sb.append(
1698                            "<column><column-name>publishDate</column-name><column-value><![CDATA[");
1699                    sb.append(getPublishDate());
1700                    sb.append("]]></column-value></column>");
1701                    sb.append(
1702                            "<column><column-name>expirationDate</column-name><column-value><![CDATA[");
1703                    sb.append(getExpirationDate());
1704                    sb.append("]]></column-value></column>");
1705                    sb.append(
1706                            "<column><column-name>mimeType</column-name><column-value><![CDATA[");
1707                    sb.append(getMimeType());
1708                    sb.append("]]></column-value></column>");
1709                    sb.append(
1710                            "<column><column-name>title</column-name><column-value><![CDATA[");
1711                    sb.append(getTitle());
1712                    sb.append("]]></column-value></column>");
1713                    sb.append(
1714                            "<column><column-name>description</column-name><column-value><![CDATA[");
1715                    sb.append(getDescription());
1716                    sb.append("]]></column-value></column>");
1717                    sb.append(
1718                            "<column><column-name>summary</column-name><column-value><![CDATA[");
1719                    sb.append(getSummary());
1720                    sb.append("]]></column-value></column>");
1721                    sb.append(
1722                            "<column><column-name>url</column-name><column-value><![CDATA[");
1723                    sb.append(getUrl());
1724                    sb.append("]]></column-value></column>");
1725                    sb.append(
1726                            "<column><column-name>layoutUuid</column-name><column-value><![CDATA[");
1727                    sb.append(getLayoutUuid());
1728                    sb.append("]]></column-value></column>");
1729                    sb.append(
1730                            "<column><column-name>height</column-name><column-value><![CDATA[");
1731                    sb.append(getHeight());
1732                    sb.append("]]></column-value></column>");
1733                    sb.append(
1734                            "<column><column-name>width</column-name><column-value><![CDATA[");
1735                    sb.append(getWidth());
1736                    sb.append("]]></column-value></column>");
1737                    sb.append(
1738                            "<column><column-name>priority</column-name><column-value><![CDATA[");
1739                    sb.append(getPriority());
1740                    sb.append("]]></column-value></column>");
1741                    sb.append(
1742                            "<column><column-name>viewCount</column-name><column-value><![CDATA[");
1743                    sb.append(getViewCount());
1744                    sb.append("]]></column-value></column>");
1745    
1746                    sb.append("</model>");
1747    
1748                    return sb.toString();
1749            }
1750    
1751            private static final ClassLoader _classLoader = AssetEntry.class.getClassLoader();
1752            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1753                            AssetEntry.class
1754                    };
1755            private long _entryId;
1756            private long _groupId;
1757            private long _originalGroupId;
1758            private boolean _setOriginalGroupId;
1759            private long _companyId;
1760            private long _originalCompanyId;
1761            private boolean _setOriginalCompanyId;
1762            private long _userId;
1763            private String _userName;
1764            private Date _createDate;
1765            private Date _modifiedDate;
1766            private long _classNameId;
1767            private long _originalClassNameId;
1768            private boolean _setOriginalClassNameId;
1769            private long _classPK;
1770            private long _originalClassPK;
1771            private boolean _setOriginalClassPK;
1772            private String _classUuid;
1773            private String _originalClassUuid;
1774            private long _classTypeId;
1775            private boolean _visible;
1776            private boolean _originalVisible;
1777            private boolean _setOriginalVisible;
1778            private Date _startDate;
1779            private Date _endDate;
1780            private Date _publishDate;
1781            private Date _originalPublishDate;
1782            private Date _expirationDate;
1783            private Date _originalExpirationDate;
1784            private String _mimeType;
1785            private String _title;
1786            private String _titleCurrentLanguageId;
1787            private String _description;
1788            private String _descriptionCurrentLanguageId;
1789            private String _summary;
1790            private String _summaryCurrentLanguageId;
1791            private String _url;
1792            private String _layoutUuid;
1793            private String _originalLayoutUuid;
1794            private int _height;
1795            private int _width;
1796            private double _priority;
1797            private int _viewCount;
1798            private long _columnBitmask;
1799            private AssetEntry _escapedModel;
1800    }