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