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.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    }