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