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.ExpandoValue;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing ExpandoValue in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see ExpandoValue
030     * @generated
031     */
032    public class ExpandoValueCacheModel implements CacheModel<ExpandoValue>,
033            Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(17);
037    
038                    sb.append("{valueId=");
039                    sb.append(valueId);
040                    sb.append(", companyId=");
041                    sb.append(companyId);
042                    sb.append(", tableId=");
043                    sb.append(tableId);
044                    sb.append(", columnId=");
045                    sb.append(columnId);
046                    sb.append(", rowId=");
047                    sb.append(rowId);
048                    sb.append(", classNameId=");
049                    sb.append(classNameId);
050                    sb.append(", classPK=");
051                    sb.append(classPK);
052                    sb.append(", data=");
053                    sb.append(data);
054                    sb.append("}");
055    
056                    return sb.toString();
057            }
058    
059            public ExpandoValue toEntityModel() {
060                    ExpandoValueImpl expandoValueImpl = new ExpandoValueImpl();
061    
062                    expandoValueImpl.setValueId(valueId);
063                    expandoValueImpl.setCompanyId(companyId);
064                    expandoValueImpl.setTableId(tableId);
065                    expandoValueImpl.setColumnId(columnId);
066                    expandoValueImpl.setRowId(rowId);
067                    expandoValueImpl.setClassNameId(classNameId);
068                    expandoValueImpl.setClassPK(classPK);
069    
070                    if (data == null) {
071                            expandoValueImpl.setData(StringPool.BLANK);
072                    }
073                    else {
074                            expandoValueImpl.setData(data);
075                    }
076    
077                    expandoValueImpl.resetOriginalValues();
078    
079                    return expandoValueImpl;
080            }
081    
082            public long valueId;
083            public long companyId;
084            public long tableId;
085            public long columnId;
086            public long rowId;
087            public long classNameId;
088            public long classPK;
089            public String data;
090    }