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