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