001    /**
002     * Copyright (c) 2000-2012 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 com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.kernel.util.StringPool;
019    import com.liferay.portal.model.CacheModel;
020    
021    import com.liferay.portlet.dynamicdatalists.model.DDLRecordSet;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing DDLRecordSet in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DDLRecordSet
032     * @generated
033     */
034    public class DDLRecordSetCacheModel implements CacheModel<DDLRecordSet>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(29);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", recordSetId=");
043                    sb.append(recordSetId);
044                    sb.append(", groupId=");
045                    sb.append(groupId);
046                    sb.append(", companyId=");
047                    sb.append(companyId);
048                    sb.append(", userId=");
049                    sb.append(userId);
050                    sb.append(", userName=");
051                    sb.append(userName);
052                    sb.append(", createDate=");
053                    sb.append(createDate);
054                    sb.append(", modifiedDate=");
055                    sb.append(modifiedDate);
056                    sb.append(", DDMStructureId=");
057                    sb.append(DDMStructureId);
058                    sb.append(", recordSetKey=");
059                    sb.append(recordSetKey);
060                    sb.append(", name=");
061                    sb.append(name);
062                    sb.append(", description=");
063                    sb.append(description);
064                    sb.append(", minDisplayRows=");
065                    sb.append(minDisplayRows);
066                    sb.append(", scope=");
067                    sb.append(scope);
068                    sb.append("}");
069    
070                    return sb.toString();
071            }
072    
073            public DDLRecordSet toEntityModel() {
074                    DDLRecordSetImpl ddlRecordSetImpl = new DDLRecordSetImpl();
075    
076                    if (uuid == null) {
077                            ddlRecordSetImpl.setUuid(StringPool.BLANK);
078                    }
079                    else {
080                            ddlRecordSetImpl.setUuid(uuid);
081                    }
082    
083                    ddlRecordSetImpl.setRecordSetId(recordSetId);
084                    ddlRecordSetImpl.setGroupId(groupId);
085                    ddlRecordSetImpl.setCompanyId(companyId);
086                    ddlRecordSetImpl.setUserId(userId);
087    
088                    if (userName == null) {
089                            ddlRecordSetImpl.setUserName(StringPool.BLANK);
090                    }
091                    else {
092                            ddlRecordSetImpl.setUserName(userName);
093                    }
094    
095                    if (createDate == Long.MIN_VALUE) {
096                            ddlRecordSetImpl.setCreateDate(null);
097                    }
098                    else {
099                            ddlRecordSetImpl.setCreateDate(new Date(createDate));
100                    }
101    
102                    if (modifiedDate == Long.MIN_VALUE) {
103                            ddlRecordSetImpl.setModifiedDate(null);
104                    }
105                    else {
106                            ddlRecordSetImpl.setModifiedDate(new Date(modifiedDate));
107                    }
108    
109                    ddlRecordSetImpl.setDDMStructureId(DDMStructureId);
110    
111                    if (recordSetKey == null) {
112                            ddlRecordSetImpl.setRecordSetKey(StringPool.BLANK);
113                    }
114                    else {
115                            ddlRecordSetImpl.setRecordSetKey(recordSetKey);
116                    }
117    
118                    if (name == null) {
119                            ddlRecordSetImpl.setName(StringPool.BLANK);
120                    }
121                    else {
122                            ddlRecordSetImpl.setName(name);
123                    }
124    
125                    if (description == null) {
126                            ddlRecordSetImpl.setDescription(StringPool.BLANK);
127                    }
128                    else {
129                            ddlRecordSetImpl.setDescription(description);
130                    }
131    
132                    ddlRecordSetImpl.setMinDisplayRows(minDisplayRows);
133                    ddlRecordSetImpl.setScope(scope);
134    
135                    ddlRecordSetImpl.resetOriginalValues();
136    
137                    return ddlRecordSetImpl;
138            }
139    
140            public String uuid;
141            public long recordSetId;
142            public long groupId;
143            public long companyId;
144            public long userId;
145            public String userName;
146            public long createDate;
147            public long modifiedDate;
148            public long DDMStructureId;
149            public String recordSetKey;
150            public String name;
151            public String description;
152            public int minDisplayRows;
153            public int scope;
154    }