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