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