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.portal.model.impl;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.json.JSON;
022    import com.liferay.portal.kernel.util.GetterUtil;
023    import com.liferay.portal.kernel.util.ProxyUtil;
024    import com.liferay.portal.kernel.util.StringBundler;
025    import com.liferay.portal.kernel.util.StringPool;
026    import com.liferay.portal.kernel.util.Validator;
027    import com.liferay.portal.model.CacheModel;
028    import com.liferay.portal.model.Repository;
029    import com.liferay.portal.model.RepositoryModel;
030    import com.liferay.portal.model.RepositorySoap;
031    import com.liferay.portal.model.User;
032    import com.liferay.portal.service.ServiceContext;
033    import com.liferay.portal.service.UserLocalServiceUtil;
034    import com.liferay.portal.util.PortalUtil;
035    
036    import com.liferay.portlet.expando.model.ExpandoBridge;
037    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
038    import com.liferay.portlet.exportimport.lar.StagedModelType;
039    
040    import java.io.Serializable;
041    
042    import java.sql.Types;
043    
044    import java.util.ArrayList;
045    import java.util.Date;
046    import java.util.HashMap;
047    import java.util.List;
048    import java.util.Map;
049    
050    /**
051     * The base model implementation for the Repository service. Represents a row in the "Repository" database table, with each column mapped to a property of this class.
052     *
053     * <p>
054     * This implementation and its corresponding interface {@link RepositoryModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link RepositoryImpl}.
055     * </p>
056     *
057     * @author Brian Wing Shun Chan
058     * @see RepositoryImpl
059     * @see Repository
060     * @see RepositoryModel
061     * @generated
062     */
063    @JSON(strict = true)
064    @ProviderType
065    public class RepositoryModelImpl extends BaseModelImpl<Repository>
066            implements RepositoryModel {
067            /*
068             * NOTE FOR DEVELOPERS:
069             *
070             * Never modify or reference this class directly. All methods that expect a repository model instance should use the {@link Repository} interface instead.
071             */
072            public static final String TABLE_NAME = "Repository";
073            public static final Object[][] TABLE_COLUMNS = {
074                            { "mvccVersion", Types.BIGINT },
075                            { "uuid_", Types.VARCHAR },
076                            { "repositoryId", Types.BIGINT },
077                            { "groupId", Types.BIGINT },
078                            { "companyId", Types.BIGINT },
079                            { "userId", Types.BIGINT },
080                            { "userName", Types.VARCHAR },
081                            { "createDate", Types.TIMESTAMP },
082                            { "modifiedDate", Types.TIMESTAMP },
083                            { "classNameId", Types.BIGINT },
084                            { "name", Types.VARCHAR },
085                            { "description", Types.VARCHAR },
086                            { "portletId", Types.VARCHAR },
087                            { "typeSettings", Types.CLOB },
088                            { "dlFolderId", Types.BIGINT },
089                            { "lastPublishDate", Types.TIMESTAMP }
090                    };
091            public static final Map<String, Integer> TABLE_COLUMNS_MAP = new HashMap<String, Integer>();
092    
093            static {
094                    TABLE_COLUMNS_MAP.put("mvccVersion", Types.BIGINT);
095                    TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR);
096                    TABLE_COLUMNS_MAP.put("repositoryId", Types.BIGINT);
097                    TABLE_COLUMNS_MAP.put("groupId", Types.BIGINT);
098                    TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT);
099                    TABLE_COLUMNS_MAP.put("userId", Types.BIGINT);
100                    TABLE_COLUMNS_MAP.put("userName", Types.VARCHAR);
101                    TABLE_COLUMNS_MAP.put("createDate", Types.TIMESTAMP);
102                    TABLE_COLUMNS_MAP.put("modifiedDate", Types.TIMESTAMP);
103                    TABLE_COLUMNS_MAP.put("classNameId", Types.BIGINT);
104                    TABLE_COLUMNS_MAP.put("name", Types.VARCHAR);
105                    TABLE_COLUMNS_MAP.put("description", Types.VARCHAR);
106                    TABLE_COLUMNS_MAP.put("portletId", Types.VARCHAR);
107                    TABLE_COLUMNS_MAP.put("typeSettings", Types.CLOB);
108                    TABLE_COLUMNS_MAP.put("dlFolderId", Types.BIGINT);
109                    TABLE_COLUMNS_MAP.put("lastPublishDate", Types.TIMESTAMP);
110            }
111    
112            public static final String TABLE_SQL_CREATE = "create table Repository (mvccVersion LONG default 0,uuid_ VARCHAR(75) null,repositoryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,classNameId LONG,name VARCHAR(75) null,description STRING null,portletId VARCHAR(200) null,typeSettings TEXT null,dlFolderId LONG,lastPublishDate DATE null)";
113            public static final String TABLE_SQL_DROP = "drop table Repository";
114            public static final String ORDER_BY_JPQL = " ORDER BY repository.repositoryId ASC";
115            public static final String ORDER_BY_SQL = " ORDER BY Repository.repositoryId ASC";
116            public static final String DATA_SOURCE = "liferayDataSource";
117            public static final String SESSION_FACTORY = "liferaySessionFactory";
118            public static final String TX_MANAGER = "liferayTransactionManager";
119            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
120                                    "value.object.entity.cache.enabled.com.liferay.portal.model.Repository"),
121                            true);
122            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
123                                    "value.object.finder.cache.enabled.com.liferay.portal.model.Repository"),
124                            true);
125            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
126                                    "value.object.column.bitmask.enabled.com.liferay.portal.model.Repository"),
127                            true);
128            public static final long COMPANYID_COLUMN_BITMASK = 1L;
129            public static final long GROUPID_COLUMN_BITMASK = 2L;
130            public static final long NAME_COLUMN_BITMASK = 4L;
131            public static final long PORTLETID_COLUMN_BITMASK = 8L;
132            public static final long UUID_COLUMN_BITMASK = 16L;
133            public static final long REPOSITORYID_COLUMN_BITMASK = 32L;
134    
135            /**
136             * Converts the soap model instance into a normal model instance.
137             *
138             * @param soapModel the soap model instance to convert
139             * @return the normal model instance
140             */
141            public static Repository toModel(RepositorySoap soapModel) {
142                    if (soapModel == null) {
143                            return null;
144                    }
145    
146                    Repository model = new RepositoryImpl();
147    
148                    model.setMvccVersion(soapModel.getMvccVersion());
149                    model.setUuid(soapModel.getUuid());
150                    model.setRepositoryId(soapModel.getRepositoryId());
151                    model.setGroupId(soapModel.getGroupId());
152                    model.setCompanyId(soapModel.getCompanyId());
153                    model.setUserId(soapModel.getUserId());
154                    model.setUserName(soapModel.getUserName());
155                    model.setCreateDate(soapModel.getCreateDate());
156                    model.setModifiedDate(soapModel.getModifiedDate());
157                    model.setClassNameId(soapModel.getClassNameId());
158                    model.setName(soapModel.getName());
159                    model.setDescription(soapModel.getDescription());
160                    model.setPortletId(soapModel.getPortletId());
161                    model.setTypeSettings(soapModel.getTypeSettings());
162                    model.setDlFolderId(soapModel.getDlFolderId());
163                    model.setLastPublishDate(soapModel.getLastPublishDate());
164    
165                    return model;
166            }
167    
168            /**
169             * Converts the soap model instances into normal model instances.
170             *
171             * @param soapModels the soap model instances to convert
172             * @return the normal model instances
173             */
174            public static List<Repository> toModels(RepositorySoap[] soapModels) {
175                    if (soapModels == null) {
176                            return null;
177                    }
178    
179                    List<Repository> models = new ArrayList<Repository>(soapModels.length);
180    
181                    for (RepositorySoap soapModel : soapModels) {
182                            models.add(toModel(soapModel));
183                    }
184    
185                    return models;
186            }
187    
188            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
189                                    "lock.expiration.time.com.liferay.portal.model.Repository"));
190    
191            public RepositoryModelImpl() {
192            }
193    
194            @Override
195            public long getPrimaryKey() {
196                    return _repositoryId;
197            }
198    
199            @Override
200            public void setPrimaryKey(long primaryKey) {
201                    setRepositoryId(primaryKey);
202            }
203    
204            @Override
205            public Serializable getPrimaryKeyObj() {
206                    return _repositoryId;
207            }
208    
209            @Override
210            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
211                    setPrimaryKey(((Long)primaryKeyObj).longValue());
212            }
213    
214            @Override
215            public Class<?> getModelClass() {
216                    return Repository.class;
217            }
218    
219            @Override
220            public String getModelClassName() {
221                    return Repository.class.getName();
222            }
223    
224            @Override
225            public Map<String, Object> getModelAttributes() {
226                    Map<String, Object> attributes = new HashMap<String, Object>();
227    
228                    attributes.put("mvccVersion", getMvccVersion());
229                    attributes.put("uuid", getUuid());
230                    attributes.put("repositoryId", getRepositoryId());
231                    attributes.put("groupId", getGroupId());
232                    attributes.put("companyId", getCompanyId());
233                    attributes.put("userId", getUserId());
234                    attributes.put("userName", getUserName());
235                    attributes.put("createDate", getCreateDate());
236                    attributes.put("modifiedDate", getModifiedDate());
237                    attributes.put("classNameId", getClassNameId());
238                    attributes.put("name", getName());
239                    attributes.put("description", getDescription());
240                    attributes.put("portletId", getPortletId());
241                    attributes.put("typeSettings", getTypeSettings());
242                    attributes.put("dlFolderId", getDlFolderId());
243                    attributes.put("lastPublishDate", getLastPublishDate());
244    
245                    attributes.put("entityCacheEnabled", isEntityCacheEnabled());
246                    attributes.put("finderCacheEnabled", isFinderCacheEnabled());
247    
248                    return attributes;
249            }
250    
251            @Override
252            public void setModelAttributes(Map<String, Object> attributes) {
253                    Long mvccVersion = (Long)attributes.get("mvccVersion");
254    
255                    if (mvccVersion != null) {
256                            setMvccVersion(mvccVersion);
257                    }
258    
259                    String uuid = (String)attributes.get("uuid");
260    
261                    if (uuid != null) {
262                            setUuid(uuid);
263                    }
264    
265                    Long repositoryId = (Long)attributes.get("repositoryId");
266    
267                    if (repositoryId != null) {
268                            setRepositoryId(repositoryId);
269                    }
270    
271                    Long groupId = (Long)attributes.get("groupId");
272    
273                    if (groupId != null) {
274                            setGroupId(groupId);
275                    }
276    
277                    Long companyId = (Long)attributes.get("companyId");
278    
279                    if (companyId != null) {
280                            setCompanyId(companyId);
281                    }
282    
283                    Long userId = (Long)attributes.get("userId");
284    
285                    if (userId != null) {
286                            setUserId(userId);
287                    }
288    
289                    String userName = (String)attributes.get("userName");
290    
291                    if (userName != null) {
292                            setUserName(userName);
293                    }
294    
295                    Date createDate = (Date)attributes.get("createDate");
296    
297                    if (createDate != null) {
298                            setCreateDate(createDate);
299                    }
300    
301                    Date modifiedDate = (Date)attributes.get("modifiedDate");
302    
303                    if (modifiedDate != null) {
304                            setModifiedDate(modifiedDate);
305                    }
306    
307                    Long classNameId = (Long)attributes.get("classNameId");
308    
309                    if (classNameId != null) {
310                            setClassNameId(classNameId);
311                    }
312    
313                    String name = (String)attributes.get("name");
314    
315                    if (name != null) {
316                            setName(name);
317                    }
318    
319                    String description = (String)attributes.get("description");
320    
321                    if (description != null) {
322                            setDescription(description);
323                    }
324    
325                    String portletId = (String)attributes.get("portletId");
326    
327                    if (portletId != null) {
328                            setPortletId(portletId);
329                    }
330    
331                    String typeSettings = (String)attributes.get("typeSettings");
332    
333                    if (typeSettings != null) {
334                            setTypeSettings(typeSettings);
335                    }
336    
337                    Long dlFolderId = (Long)attributes.get("dlFolderId");
338    
339                    if (dlFolderId != null) {
340                            setDlFolderId(dlFolderId);
341                    }
342    
343                    Date lastPublishDate = (Date)attributes.get("lastPublishDate");
344    
345                    if (lastPublishDate != null) {
346                            setLastPublishDate(lastPublishDate);
347                    }
348            }
349    
350            @JSON
351            @Override
352            public long getMvccVersion() {
353                    return _mvccVersion;
354            }
355    
356            @Override
357            public void setMvccVersion(long mvccVersion) {
358                    _mvccVersion = mvccVersion;
359            }
360    
361            @JSON
362            @Override
363            public String getUuid() {
364                    if (_uuid == null) {
365                            return StringPool.BLANK;
366                    }
367                    else {
368                            return _uuid;
369                    }
370            }
371    
372            @Override
373            public void setUuid(String uuid) {
374                    if (_originalUuid == null) {
375                            _originalUuid = _uuid;
376                    }
377    
378                    _uuid = uuid;
379            }
380    
381            public String getOriginalUuid() {
382                    return GetterUtil.getString(_originalUuid);
383            }
384    
385            @JSON
386            @Override
387            public long getRepositoryId() {
388                    return _repositoryId;
389            }
390    
391            @Override
392            public void setRepositoryId(long repositoryId) {
393                    _repositoryId = repositoryId;
394            }
395    
396            @JSON
397            @Override
398            public long getGroupId() {
399                    return _groupId;
400            }
401    
402            @Override
403            public void setGroupId(long groupId) {
404                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
405    
406                    if (!_setOriginalGroupId) {
407                            _setOriginalGroupId = true;
408    
409                            _originalGroupId = _groupId;
410                    }
411    
412                    _groupId = groupId;
413            }
414    
415            public long getOriginalGroupId() {
416                    return _originalGroupId;
417            }
418    
419            @JSON
420            @Override
421            public long getCompanyId() {
422                    return _companyId;
423            }
424    
425            @Override
426            public void setCompanyId(long companyId) {
427                    _columnBitmask |= COMPANYID_COLUMN_BITMASK;
428    
429                    if (!_setOriginalCompanyId) {
430                            _setOriginalCompanyId = true;
431    
432                            _originalCompanyId = _companyId;
433                    }
434    
435                    _companyId = companyId;
436            }
437    
438            public long getOriginalCompanyId() {
439                    return _originalCompanyId;
440            }
441    
442            @JSON
443            @Override
444            public long getUserId() {
445                    return _userId;
446            }
447    
448            @Override
449            public void setUserId(long userId) {
450                    _userId = userId;
451            }
452    
453            @Override
454            public String getUserUuid() {
455                    try {
456                            User user = UserLocalServiceUtil.getUserById(getUserId());
457    
458                            return user.getUuid();
459                    }
460                    catch (PortalException pe) {
461                            return StringPool.BLANK;
462                    }
463            }
464    
465            @Override
466            public void setUserUuid(String userUuid) {
467            }
468    
469            @JSON
470            @Override
471            public String getUserName() {
472                    if (_userName == null) {
473                            return StringPool.BLANK;
474                    }
475                    else {
476                            return _userName;
477                    }
478            }
479    
480            @Override
481            public void setUserName(String userName) {
482                    _userName = userName;
483            }
484    
485            @JSON
486            @Override
487            public Date getCreateDate() {
488                    return _createDate;
489            }
490    
491            @Override
492            public void setCreateDate(Date createDate) {
493                    _createDate = createDate;
494            }
495    
496            @JSON
497            @Override
498            public Date getModifiedDate() {
499                    return _modifiedDate;
500            }
501    
502            public boolean hasSetModifiedDate() {
503                    return _setModifiedDate;
504            }
505    
506            @Override
507            public void setModifiedDate(Date modifiedDate) {
508                    _setModifiedDate = true;
509    
510                    _modifiedDate = modifiedDate;
511            }
512    
513            @Override
514            public String getClassName() {
515                    if (getClassNameId() <= 0) {
516                            return StringPool.BLANK;
517                    }
518    
519                    return PortalUtil.getClassName(getClassNameId());
520            }
521    
522            @Override
523            public void setClassName(String className) {
524                    long classNameId = 0;
525    
526                    if (Validator.isNotNull(className)) {
527                            classNameId = PortalUtil.getClassNameId(className);
528                    }
529    
530                    setClassNameId(classNameId);
531            }
532    
533            @JSON
534            @Override
535            public long getClassNameId() {
536                    return _classNameId;
537            }
538    
539            @Override
540            public void setClassNameId(long classNameId) {
541                    _classNameId = classNameId;
542            }
543    
544            @JSON
545            @Override
546            public String getName() {
547                    if (_name == null) {
548                            return StringPool.BLANK;
549                    }
550                    else {
551                            return _name;
552                    }
553            }
554    
555            @Override
556            public void setName(String name) {
557                    _columnBitmask |= NAME_COLUMN_BITMASK;
558    
559                    if (_originalName == null) {
560                            _originalName = _name;
561                    }
562    
563                    _name = name;
564            }
565    
566            public String getOriginalName() {
567                    return GetterUtil.getString(_originalName);
568            }
569    
570            @JSON
571            @Override
572            public String getDescription() {
573                    if (_description == null) {
574                            return StringPool.BLANK;
575                    }
576                    else {
577                            return _description;
578                    }
579            }
580    
581            @Override
582            public void setDescription(String description) {
583                    _description = description;
584            }
585    
586            @JSON
587            @Override
588            public String getPortletId() {
589                    if (_portletId == null) {
590                            return StringPool.BLANK;
591                    }
592                    else {
593                            return _portletId;
594                    }
595            }
596    
597            @Override
598            public void setPortletId(String portletId) {
599                    _columnBitmask |= PORTLETID_COLUMN_BITMASK;
600    
601                    if (_originalPortletId == null) {
602                            _originalPortletId = _portletId;
603                    }
604    
605                    _portletId = portletId;
606            }
607    
608            public String getOriginalPortletId() {
609                    return GetterUtil.getString(_originalPortletId);
610            }
611    
612            @JSON
613            @Override
614            public String getTypeSettings() {
615                    if (_typeSettings == null) {
616                            return StringPool.BLANK;
617                    }
618                    else {
619                            return _typeSettings;
620                    }
621            }
622    
623            @Override
624            public void setTypeSettings(String typeSettings) {
625                    _typeSettings = typeSettings;
626            }
627    
628            @JSON
629            @Override
630            public long getDlFolderId() {
631                    return _dlFolderId;
632            }
633    
634            @Override
635            public void setDlFolderId(long dlFolderId) {
636                    _dlFolderId = dlFolderId;
637            }
638    
639            @JSON
640            @Override
641            public Date getLastPublishDate() {
642                    return _lastPublishDate;
643            }
644    
645            @Override
646            public void setLastPublishDate(Date lastPublishDate) {
647                    _lastPublishDate = lastPublishDate;
648            }
649    
650            @Override
651            public StagedModelType getStagedModelType() {
652                    return new StagedModelType(PortalUtil.getClassNameId(
653                                    Repository.class.getName()), getClassNameId());
654            }
655    
656            public long getColumnBitmask() {
657                    return _columnBitmask;
658            }
659    
660            @Override
661            public ExpandoBridge getExpandoBridge() {
662                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
663                            Repository.class.getName(), getPrimaryKey());
664            }
665    
666            @Override
667            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
668                    ExpandoBridge expandoBridge = getExpandoBridge();
669    
670                    expandoBridge.setAttributes(serviceContext);
671            }
672    
673            @Override
674            public Repository toEscapedModel() {
675                    if (_escapedModel == null) {
676                            _escapedModel = (Repository)ProxyUtil.newProxyInstance(_classLoader,
677                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
678                    }
679    
680                    return _escapedModel;
681            }
682    
683            @Override
684            public Object clone() {
685                    RepositoryImpl repositoryImpl = new RepositoryImpl();
686    
687                    repositoryImpl.setMvccVersion(getMvccVersion());
688                    repositoryImpl.setUuid(getUuid());
689                    repositoryImpl.setRepositoryId(getRepositoryId());
690                    repositoryImpl.setGroupId(getGroupId());
691                    repositoryImpl.setCompanyId(getCompanyId());
692                    repositoryImpl.setUserId(getUserId());
693                    repositoryImpl.setUserName(getUserName());
694                    repositoryImpl.setCreateDate(getCreateDate());
695                    repositoryImpl.setModifiedDate(getModifiedDate());
696                    repositoryImpl.setClassNameId(getClassNameId());
697                    repositoryImpl.setName(getName());
698                    repositoryImpl.setDescription(getDescription());
699                    repositoryImpl.setPortletId(getPortletId());
700                    repositoryImpl.setTypeSettings(getTypeSettings());
701                    repositoryImpl.setDlFolderId(getDlFolderId());
702                    repositoryImpl.setLastPublishDate(getLastPublishDate());
703    
704                    repositoryImpl.resetOriginalValues();
705    
706                    return repositoryImpl;
707            }
708    
709            @Override
710            public int compareTo(Repository repository) {
711                    long primaryKey = repository.getPrimaryKey();
712    
713                    if (getPrimaryKey() < primaryKey) {
714                            return -1;
715                    }
716                    else if (getPrimaryKey() > primaryKey) {
717                            return 1;
718                    }
719                    else {
720                            return 0;
721                    }
722            }
723    
724            @Override
725            public boolean equals(Object obj) {
726                    if (this == obj) {
727                            return true;
728                    }
729    
730                    if (!(obj instanceof Repository)) {
731                            return false;
732                    }
733    
734                    Repository repository = (Repository)obj;
735    
736                    long primaryKey = repository.getPrimaryKey();
737    
738                    if (getPrimaryKey() == primaryKey) {
739                            return true;
740                    }
741                    else {
742                            return false;
743                    }
744            }
745    
746            @Override
747            public int hashCode() {
748                    return (int)getPrimaryKey();
749            }
750    
751            @Override
752            public boolean isEntityCacheEnabled() {
753                    return ENTITY_CACHE_ENABLED;
754            }
755    
756            @Override
757            public boolean isFinderCacheEnabled() {
758                    return FINDER_CACHE_ENABLED;
759            }
760    
761            @Override
762            public void resetOriginalValues() {
763                    RepositoryModelImpl repositoryModelImpl = this;
764    
765                    repositoryModelImpl._originalUuid = repositoryModelImpl._uuid;
766    
767                    repositoryModelImpl._originalGroupId = repositoryModelImpl._groupId;
768    
769                    repositoryModelImpl._setOriginalGroupId = false;
770    
771                    repositoryModelImpl._originalCompanyId = repositoryModelImpl._companyId;
772    
773                    repositoryModelImpl._setOriginalCompanyId = false;
774    
775                    repositoryModelImpl._setModifiedDate = false;
776    
777                    repositoryModelImpl._originalName = repositoryModelImpl._name;
778    
779                    repositoryModelImpl._originalPortletId = repositoryModelImpl._portletId;
780    
781                    repositoryModelImpl._columnBitmask = 0;
782            }
783    
784            @Override
785            public CacheModel<Repository> toCacheModel() {
786                    RepositoryCacheModel repositoryCacheModel = new RepositoryCacheModel();
787    
788                    repositoryCacheModel.mvccVersion = getMvccVersion();
789    
790                    repositoryCacheModel.uuid = getUuid();
791    
792                    String uuid = repositoryCacheModel.uuid;
793    
794                    if ((uuid != null) && (uuid.length() == 0)) {
795                            repositoryCacheModel.uuid = null;
796                    }
797    
798                    repositoryCacheModel.repositoryId = getRepositoryId();
799    
800                    repositoryCacheModel.groupId = getGroupId();
801    
802                    repositoryCacheModel.companyId = getCompanyId();
803    
804                    repositoryCacheModel.userId = getUserId();
805    
806                    repositoryCacheModel.userName = getUserName();
807    
808                    String userName = repositoryCacheModel.userName;
809    
810                    if ((userName != null) && (userName.length() == 0)) {
811                            repositoryCacheModel.userName = null;
812                    }
813    
814                    Date createDate = getCreateDate();
815    
816                    if (createDate != null) {
817                            repositoryCacheModel.createDate = createDate.getTime();
818                    }
819                    else {
820                            repositoryCacheModel.createDate = Long.MIN_VALUE;
821                    }
822    
823                    Date modifiedDate = getModifiedDate();
824    
825                    if (modifiedDate != null) {
826                            repositoryCacheModel.modifiedDate = modifiedDate.getTime();
827                    }
828                    else {
829                            repositoryCacheModel.modifiedDate = Long.MIN_VALUE;
830                    }
831    
832                    repositoryCacheModel.classNameId = getClassNameId();
833    
834                    repositoryCacheModel.name = getName();
835    
836                    String name = repositoryCacheModel.name;
837    
838                    if ((name != null) && (name.length() == 0)) {
839                            repositoryCacheModel.name = null;
840                    }
841    
842                    repositoryCacheModel.description = getDescription();
843    
844                    String description = repositoryCacheModel.description;
845    
846                    if ((description != null) && (description.length() == 0)) {
847                            repositoryCacheModel.description = null;
848                    }
849    
850                    repositoryCacheModel.portletId = getPortletId();
851    
852                    String portletId = repositoryCacheModel.portletId;
853    
854                    if ((portletId != null) && (portletId.length() == 0)) {
855                            repositoryCacheModel.portletId = null;
856                    }
857    
858                    repositoryCacheModel.typeSettings = getTypeSettings();
859    
860                    String typeSettings = repositoryCacheModel.typeSettings;
861    
862                    if ((typeSettings != null) && (typeSettings.length() == 0)) {
863                            repositoryCacheModel.typeSettings = null;
864                    }
865    
866                    repositoryCacheModel.dlFolderId = getDlFolderId();
867    
868                    Date lastPublishDate = getLastPublishDate();
869    
870                    if (lastPublishDate != null) {
871                            repositoryCacheModel.lastPublishDate = lastPublishDate.getTime();
872                    }
873                    else {
874                            repositoryCacheModel.lastPublishDate = Long.MIN_VALUE;
875                    }
876    
877                    return repositoryCacheModel;
878            }
879    
880            @Override
881            public String toString() {
882                    StringBundler sb = new StringBundler(33);
883    
884                    sb.append("{mvccVersion=");
885                    sb.append(getMvccVersion());
886                    sb.append(", uuid=");
887                    sb.append(getUuid());
888                    sb.append(", repositoryId=");
889                    sb.append(getRepositoryId());
890                    sb.append(", groupId=");
891                    sb.append(getGroupId());
892                    sb.append(", companyId=");
893                    sb.append(getCompanyId());
894                    sb.append(", userId=");
895                    sb.append(getUserId());
896                    sb.append(", userName=");
897                    sb.append(getUserName());
898                    sb.append(", createDate=");
899                    sb.append(getCreateDate());
900                    sb.append(", modifiedDate=");
901                    sb.append(getModifiedDate());
902                    sb.append(", classNameId=");
903                    sb.append(getClassNameId());
904                    sb.append(", name=");
905                    sb.append(getName());
906                    sb.append(", description=");
907                    sb.append(getDescription());
908                    sb.append(", portletId=");
909                    sb.append(getPortletId());
910                    sb.append(", typeSettings=");
911                    sb.append(getTypeSettings());
912                    sb.append(", dlFolderId=");
913                    sb.append(getDlFolderId());
914                    sb.append(", lastPublishDate=");
915                    sb.append(getLastPublishDate());
916                    sb.append("}");
917    
918                    return sb.toString();
919            }
920    
921            @Override
922            public String toXmlString() {
923                    StringBundler sb = new StringBundler(52);
924    
925                    sb.append("<model><model-name>");
926                    sb.append("com.liferay.portal.model.Repository");
927                    sb.append("</model-name>");
928    
929                    sb.append(
930                            "<column><column-name>mvccVersion</column-name><column-value><![CDATA[");
931                    sb.append(getMvccVersion());
932                    sb.append("]]></column-value></column>");
933                    sb.append(
934                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
935                    sb.append(getUuid());
936                    sb.append("]]></column-value></column>");
937                    sb.append(
938                            "<column><column-name>repositoryId</column-name><column-value><![CDATA[");
939                    sb.append(getRepositoryId());
940                    sb.append("]]></column-value></column>");
941                    sb.append(
942                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
943                    sb.append(getGroupId());
944                    sb.append("]]></column-value></column>");
945                    sb.append(
946                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
947                    sb.append(getCompanyId());
948                    sb.append("]]></column-value></column>");
949                    sb.append(
950                            "<column><column-name>userId</column-name><column-value><![CDATA[");
951                    sb.append(getUserId());
952                    sb.append("]]></column-value></column>");
953                    sb.append(
954                            "<column><column-name>userName</column-name><column-value><![CDATA[");
955                    sb.append(getUserName());
956                    sb.append("]]></column-value></column>");
957                    sb.append(
958                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
959                    sb.append(getCreateDate());
960                    sb.append("]]></column-value></column>");
961                    sb.append(
962                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
963                    sb.append(getModifiedDate());
964                    sb.append("]]></column-value></column>");
965                    sb.append(
966                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
967                    sb.append(getClassNameId());
968                    sb.append("]]></column-value></column>");
969                    sb.append(
970                            "<column><column-name>name</column-name><column-value><![CDATA[");
971                    sb.append(getName());
972                    sb.append("]]></column-value></column>");
973                    sb.append(
974                            "<column><column-name>description</column-name><column-value><![CDATA[");
975                    sb.append(getDescription());
976                    sb.append("]]></column-value></column>");
977                    sb.append(
978                            "<column><column-name>portletId</column-name><column-value><![CDATA[");
979                    sb.append(getPortletId());
980                    sb.append("]]></column-value></column>");
981                    sb.append(
982                            "<column><column-name>typeSettings</column-name><column-value><![CDATA[");
983                    sb.append(getTypeSettings());
984                    sb.append("]]></column-value></column>");
985                    sb.append(
986                            "<column><column-name>dlFolderId</column-name><column-value><![CDATA[");
987                    sb.append(getDlFolderId());
988                    sb.append("]]></column-value></column>");
989                    sb.append(
990                            "<column><column-name>lastPublishDate</column-name><column-value><![CDATA[");
991                    sb.append(getLastPublishDate());
992                    sb.append("]]></column-value></column>");
993    
994                    sb.append("</model>");
995    
996                    return sb.toString();
997            }
998    
999            private static final ClassLoader _classLoader = Repository.class.getClassLoader();
1000            private static final Class<?>[] _escapedModelInterfaces = new Class[] {
1001                            Repository.class
1002                    };
1003            private long _mvccVersion;
1004            private String _uuid;
1005            private String _originalUuid;
1006            private long _repositoryId;
1007            private long _groupId;
1008            private long _originalGroupId;
1009            private boolean _setOriginalGroupId;
1010            private long _companyId;
1011            private long _originalCompanyId;
1012            private boolean _setOriginalCompanyId;
1013            private long _userId;
1014            private String _userName;
1015            private Date _createDate;
1016            private Date _modifiedDate;
1017            private boolean _setModifiedDate;
1018            private long _classNameId;
1019            private String _name;
1020            private String _originalName;
1021            private String _description;
1022            private String _portletId;
1023            private String _originalPortletId;
1024            private String _typeSettings;
1025            private long _dlFolderId;
1026            private Date _lastPublishDate;
1027            private long _columnBitmask;
1028            private Repository _escapedModel;
1029    }