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.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.CacheModel;
020    import com.liferay.portal.model.Organization;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing Organization in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see Organization
029     * @generated
030     */
031    public class OrganizationCacheModel implements CacheModel<Organization>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(23);
036    
037                    sb.append("{organizationId=");
038                    sb.append(organizationId);
039                    sb.append(", companyId=");
040                    sb.append(companyId);
041                    sb.append(", parentOrganizationId=");
042                    sb.append(parentOrganizationId);
043                    sb.append(", treePath=");
044                    sb.append(treePath);
045                    sb.append(", name=");
046                    sb.append(name);
047                    sb.append(", type=");
048                    sb.append(type);
049                    sb.append(", recursable=");
050                    sb.append(recursable);
051                    sb.append(", regionId=");
052                    sb.append(regionId);
053                    sb.append(", countryId=");
054                    sb.append(countryId);
055                    sb.append(", statusId=");
056                    sb.append(statusId);
057                    sb.append(", comments=");
058                    sb.append(comments);
059                    sb.append("}");
060    
061                    return sb.toString();
062            }
063    
064            public Organization toEntityModel() {
065                    OrganizationImpl organizationImpl = new OrganizationImpl();
066    
067                    organizationImpl.setOrganizationId(organizationId);
068                    organizationImpl.setCompanyId(companyId);
069                    organizationImpl.setParentOrganizationId(parentOrganizationId);
070    
071                    if (treePath == null) {
072                            organizationImpl.setTreePath(StringPool.BLANK);
073                    }
074                    else {
075                            organizationImpl.setTreePath(treePath);
076                    }
077    
078                    if (name == null) {
079                            organizationImpl.setName(StringPool.BLANK);
080                    }
081                    else {
082                            organizationImpl.setName(name);
083                    }
084    
085                    if (type == null) {
086                            organizationImpl.setType(StringPool.BLANK);
087                    }
088                    else {
089                            organizationImpl.setType(type);
090                    }
091    
092                    organizationImpl.setRecursable(recursable);
093                    organizationImpl.setRegionId(regionId);
094                    organizationImpl.setCountryId(countryId);
095                    organizationImpl.setStatusId(statusId);
096    
097                    if (comments == null) {
098                            organizationImpl.setComments(StringPool.BLANK);
099                    }
100                    else {
101                            organizationImpl.setComments(comments);
102                    }
103    
104                    organizationImpl.resetOriginalValues();
105    
106                    return organizationImpl;
107            }
108    
109            public long organizationId;
110            public long companyId;
111            public long parentOrganizationId;
112            public String treePath;
113            public String name;
114            public String type;
115            public boolean recursable;
116            public long regionId;
117            public long countryId;
118            public int statusId;
119            public String comments;
120    }