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