001    /**
002     * Copyright (c) 2000-2013 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.journal.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.journal.model.JournalArticle;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing JournalArticle in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see JournalArticle
032     * @generated
033     */
034    public class JournalArticleCacheModel implements CacheModel<JournalArticle>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(65);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", id=");
043                    sb.append(id);
044                    sb.append(", resourcePrimKey=");
045                    sb.append(resourcePrimKey);
046                    sb.append(", groupId=");
047                    sb.append(groupId);
048                    sb.append(", companyId=");
049                    sb.append(companyId);
050                    sb.append(", userId=");
051                    sb.append(userId);
052                    sb.append(", userName=");
053                    sb.append(userName);
054                    sb.append(", createDate=");
055                    sb.append(createDate);
056                    sb.append(", modifiedDate=");
057                    sb.append(modifiedDate);
058                    sb.append(", classNameId=");
059                    sb.append(classNameId);
060                    sb.append(", classPK=");
061                    sb.append(classPK);
062                    sb.append(", articleId=");
063                    sb.append(articleId);
064                    sb.append(", version=");
065                    sb.append(version);
066                    sb.append(", title=");
067                    sb.append(title);
068                    sb.append(", urlTitle=");
069                    sb.append(urlTitle);
070                    sb.append(", description=");
071                    sb.append(description);
072                    sb.append(", content=");
073                    sb.append(content);
074                    sb.append(", type=");
075                    sb.append(type);
076                    sb.append(", structureId=");
077                    sb.append(structureId);
078                    sb.append(", templateId=");
079                    sb.append(templateId);
080                    sb.append(", layoutUuid=");
081                    sb.append(layoutUuid);
082                    sb.append(", displayDate=");
083                    sb.append(displayDate);
084                    sb.append(", expirationDate=");
085                    sb.append(expirationDate);
086                    sb.append(", reviewDate=");
087                    sb.append(reviewDate);
088                    sb.append(", indexable=");
089                    sb.append(indexable);
090                    sb.append(", smallImage=");
091                    sb.append(smallImage);
092                    sb.append(", smallImageId=");
093                    sb.append(smallImageId);
094                    sb.append(", smallImageURL=");
095                    sb.append(smallImageURL);
096                    sb.append(", status=");
097                    sb.append(status);
098                    sb.append(", statusByUserId=");
099                    sb.append(statusByUserId);
100                    sb.append(", statusByUserName=");
101                    sb.append(statusByUserName);
102                    sb.append(", statusDate=");
103                    sb.append(statusDate);
104                    sb.append("}");
105    
106                    return sb.toString();
107            }
108    
109            public JournalArticle toEntityModel() {
110                    JournalArticleImpl journalArticleImpl = new JournalArticleImpl();
111    
112                    if (uuid == null) {
113                            journalArticleImpl.setUuid(StringPool.BLANK);
114                    }
115                    else {
116                            journalArticleImpl.setUuid(uuid);
117                    }
118    
119                    journalArticleImpl.setId(id);
120                    journalArticleImpl.setResourcePrimKey(resourcePrimKey);
121                    journalArticleImpl.setGroupId(groupId);
122                    journalArticleImpl.setCompanyId(companyId);
123                    journalArticleImpl.setUserId(userId);
124    
125                    if (userName == null) {
126                            journalArticleImpl.setUserName(StringPool.BLANK);
127                    }
128                    else {
129                            journalArticleImpl.setUserName(userName);
130                    }
131    
132                    if (createDate == Long.MIN_VALUE) {
133                            journalArticleImpl.setCreateDate(null);
134                    }
135                    else {
136                            journalArticleImpl.setCreateDate(new Date(createDate));
137                    }
138    
139                    if (modifiedDate == Long.MIN_VALUE) {
140                            journalArticleImpl.setModifiedDate(null);
141                    }
142                    else {
143                            journalArticleImpl.setModifiedDate(new Date(modifiedDate));
144                    }
145    
146                    journalArticleImpl.setClassNameId(classNameId);
147                    journalArticleImpl.setClassPK(classPK);
148    
149                    if (articleId == null) {
150                            journalArticleImpl.setArticleId(StringPool.BLANK);
151                    }
152                    else {
153                            journalArticleImpl.setArticleId(articleId);
154                    }
155    
156                    journalArticleImpl.setVersion(version);
157    
158                    if (title == null) {
159                            journalArticleImpl.setTitle(StringPool.BLANK);
160                    }
161                    else {
162                            journalArticleImpl.setTitle(title);
163                    }
164    
165                    if (urlTitle == null) {
166                            journalArticleImpl.setUrlTitle(StringPool.BLANK);
167                    }
168                    else {
169                            journalArticleImpl.setUrlTitle(urlTitle);
170                    }
171    
172                    if (description == null) {
173                            journalArticleImpl.setDescription(StringPool.BLANK);
174                    }
175                    else {
176                            journalArticleImpl.setDescription(description);
177                    }
178    
179                    if (content == null) {
180                            journalArticleImpl.setContent(StringPool.BLANK);
181                    }
182                    else {
183                            journalArticleImpl.setContent(content);
184                    }
185    
186                    if (type == null) {
187                            journalArticleImpl.setType(StringPool.BLANK);
188                    }
189                    else {
190                            journalArticleImpl.setType(type);
191                    }
192    
193                    if (structureId == null) {
194                            journalArticleImpl.setStructureId(StringPool.BLANK);
195                    }
196                    else {
197                            journalArticleImpl.setStructureId(structureId);
198                    }
199    
200                    if (templateId == null) {
201                            journalArticleImpl.setTemplateId(StringPool.BLANK);
202                    }
203                    else {
204                            journalArticleImpl.setTemplateId(templateId);
205                    }
206    
207                    if (layoutUuid == null) {
208                            journalArticleImpl.setLayoutUuid(StringPool.BLANK);
209                    }
210                    else {
211                            journalArticleImpl.setLayoutUuid(layoutUuid);
212                    }
213    
214                    if (displayDate == Long.MIN_VALUE) {
215                            journalArticleImpl.setDisplayDate(null);
216                    }
217                    else {
218                            journalArticleImpl.setDisplayDate(new Date(displayDate));
219                    }
220    
221                    if (expirationDate == Long.MIN_VALUE) {
222                            journalArticleImpl.setExpirationDate(null);
223                    }
224                    else {
225                            journalArticleImpl.setExpirationDate(new Date(expirationDate));
226                    }
227    
228                    if (reviewDate == Long.MIN_VALUE) {
229                            journalArticleImpl.setReviewDate(null);
230                    }
231                    else {
232                            journalArticleImpl.setReviewDate(new Date(reviewDate));
233                    }
234    
235                    journalArticleImpl.setIndexable(indexable);
236                    journalArticleImpl.setSmallImage(smallImage);
237                    journalArticleImpl.setSmallImageId(smallImageId);
238    
239                    if (smallImageURL == null) {
240                            journalArticleImpl.setSmallImageURL(StringPool.BLANK);
241                    }
242                    else {
243                            journalArticleImpl.setSmallImageURL(smallImageURL);
244                    }
245    
246                    journalArticleImpl.setStatus(status);
247                    journalArticleImpl.setStatusByUserId(statusByUserId);
248    
249                    if (statusByUserName == null) {
250                            journalArticleImpl.setStatusByUserName(StringPool.BLANK);
251                    }
252                    else {
253                            journalArticleImpl.setStatusByUserName(statusByUserName);
254                    }
255    
256                    if (statusDate == Long.MIN_VALUE) {
257                            journalArticleImpl.setStatusDate(null);
258                    }
259                    else {
260                            journalArticleImpl.setStatusDate(new Date(statusDate));
261                    }
262    
263                    journalArticleImpl.resetOriginalValues();
264    
265                    return journalArticleImpl;
266            }
267    
268            public String uuid;
269            public long id;
270            public long resourcePrimKey;
271            public long groupId;
272            public long companyId;
273            public long userId;
274            public String userName;
275            public long createDate;
276            public long modifiedDate;
277            public long classNameId;
278            public long classPK;
279            public String articleId;
280            public double version;
281            public String title;
282            public String urlTitle;
283            public String description;
284            public String content;
285            public String type;
286            public String structureId;
287            public String templateId;
288            public String layoutUuid;
289            public long displayDate;
290            public long expirationDate;
291            public long reviewDate;
292            public boolean indexable;
293            public boolean smallImage;
294            public long smallImageId;
295            public String smallImageURL;
296            public int status;
297            public long statusByUserId;
298            public String statusByUserName;
299            public long statusDate;
300    }