001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.expando.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.expando.model.ExpandoTable;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing ExpandoTable in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see ExpandoTable
030     * @generated
031     */
032    public class ExpandoTableCacheModel implements CacheModel<ExpandoTable>,
033            Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(9);
037    
038                    sb.append("{tableId=");
039                    sb.append(tableId);
040                    sb.append(", companyId=");
041                    sb.append(companyId);
042                    sb.append(", classNameId=");
043                    sb.append(classNameId);
044                    sb.append(", name=");
045                    sb.append(name);
046                    sb.append("}");
047    
048                    return sb.toString();
049            }
050    
051            public ExpandoTable toEntityModel() {
052                    ExpandoTableImpl expandoTableImpl = new ExpandoTableImpl();
053    
054                    expandoTableImpl.setTableId(tableId);
055                    expandoTableImpl.setCompanyId(companyId);
056                    expandoTableImpl.setClassNameId(classNameId);
057    
058                    if (name == null) {
059                            expandoTableImpl.setName(StringPool.BLANK);
060                    }
061                    else {
062                            expandoTableImpl.setName(name);
063                    }
064    
065                    expandoTableImpl.resetOriginalValues();
066    
067                    return expandoTableImpl;
068            }
069    
070            public long tableId;
071            public long companyId;
072            public long classNameId;
073            public String name;
074    }