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.portal.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.Account;
020    import com.liferay.portal.model.CacheModel;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing Account in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see Account
031     * @generated
032     */
033    public class AccountCacheModel implements CacheModel<Account>, Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(33);
037    
038                    sb.append("{accountId=");
039                    sb.append(accountId);
040                    sb.append(", companyId=");
041                    sb.append(companyId);
042                    sb.append(", userId=");
043                    sb.append(userId);
044                    sb.append(", userName=");
045                    sb.append(userName);
046                    sb.append(", createDate=");
047                    sb.append(createDate);
048                    sb.append(", modifiedDate=");
049                    sb.append(modifiedDate);
050                    sb.append(", parentAccountId=");
051                    sb.append(parentAccountId);
052                    sb.append(", name=");
053                    sb.append(name);
054                    sb.append(", legalName=");
055                    sb.append(legalName);
056                    sb.append(", legalId=");
057                    sb.append(legalId);
058                    sb.append(", legalType=");
059                    sb.append(legalType);
060                    sb.append(", sicCode=");
061                    sb.append(sicCode);
062                    sb.append(", tickerSymbol=");
063                    sb.append(tickerSymbol);
064                    sb.append(", industry=");
065                    sb.append(industry);
066                    sb.append(", type=");
067                    sb.append(type);
068                    sb.append(", size=");
069                    sb.append(size);
070                    sb.append("}");
071    
072                    return sb.toString();
073            }
074    
075            public Account toEntityModel() {
076                    AccountImpl accountImpl = new AccountImpl();
077    
078                    accountImpl.setAccountId(accountId);
079                    accountImpl.setCompanyId(companyId);
080                    accountImpl.setUserId(userId);
081    
082                    if (userName == null) {
083                            accountImpl.setUserName(StringPool.BLANK);
084                    }
085                    else {
086                            accountImpl.setUserName(userName);
087                    }
088    
089                    if (createDate == Long.MIN_VALUE) {
090                            accountImpl.setCreateDate(null);
091                    }
092                    else {
093                            accountImpl.setCreateDate(new Date(createDate));
094                    }
095    
096                    if (modifiedDate == Long.MIN_VALUE) {
097                            accountImpl.setModifiedDate(null);
098                    }
099                    else {
100                            accountImpl.setModifiedDate(new Date(modifiedDate));
101                    }
102    
103                    accountImpl.setParentAccountId(parentAccountId);
104    
105                    if (name == null) {
106                            accountImpl.setName(StringPool.BLANK);
107                    }
108                    else {
109                            accountImpl.setName(name);
110                    }
111    
112                    if (legalName == null) {
113                            accountImpl.setLegalName(StringPool.BLANK);
114                    }
115                    else {
116                            accountImpl.setLegalName(legalName);
117                    }
118    
119                    if (legalId == null) {
120                            accountImpl.setLegalId(StringPool.BLANK);
121                    }
122                    else {
123                            accountImpl.setLegalId(legalId);
124                    }
125    
126                    if (legalType == null) {
127                            accountImpl.setLegalType(StringPool.BLANK);
128                    }
129                    else {
130                            accountImpl.setLegalType(legalType);
131                    }
132    
133                    if (sicCode == null) {
134                            accountImpl.setSicCode(StringPool.BLANK);
135                    }
136                    else {
137                            accountImpl.setSicCode(sicCode);
138                    }
139    
140                    if (tickerSymbol == null) {
141                            accountImpl.setTickerSymbol(StringPool.BLANK);
142                    }
143                    else {
144                            accountImpl.setTickerSymbol(tickerSymbol);
145                    }
146    
147                    if (industry == null) {
148                            accountImpl.setIndustry(StringPool.BLANK);
149                    }
150                    else {
151                            accountImpl.setIndustry(industry);
152                    }
153    
154                    if (type == null) {
155                            accountImpl.setType(StringPool.BLANK);
156                    }
157                    else {
158                            accountImpl.setType(type);
159                    }
160    
161                    if (size == null) {
162                            accountImpl.setSize(StringPool.BLANK);
163                    }
164                    else {
165                            accountImpl.setSize(size);
166                    }
167    
168                    accountImpl.resetOriginalValues();
169    
170                    return accountImpl;
171            }
172    
173            public long accountId;
174            public long companyId;
175            public long userId;
176            public String userName;
177            public long createDate;
178            public long modifiedDate;
179            public long parentAccountId;
180            public String name;
181            public String legalName;
182            public String legalId;
183            public String legalType;
184            public String sicCode;
185            public String tickerSymbol;
186            public String industry;
187            public String type;
188            public String size;
189    }