001    /**
002     * Copyright (c) 2000-2013 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.softwarecatalog.model.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.model.CacheModel;
019    
020    import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
021    
022    import java.io.Externalizable;
023    import java.io.IOException;
024    import java.io.ObjectInput;
025    import java.io.ObjectOutput;
026    
027    /**
028     * The cache model class for representing SCProductScreenshot in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see SCProductScreenshot
032     * @generated
033     */
034    public class SCProductScreenshotCacheModel implements CacheModel<SCProductScreenshot>,
035            Externalizable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(15);
039    
040                    sb.append("{productScreenshotId=");
041                    sb.append(productScreenshotId);
042                    sb.append(", companyId=");
043                    sb.append(companyId);
044                    sb.append(", groupId=");
045                    sb.append(groupId);
046                    sb.append(", productEntryId=");
047                    sb.append(productEntryId);
048                    sb.append(", thumbnailId=");
049                    sb.append(thumbnailId);
050                    sb.append(", fullImageId=");
051                    sb.append(fullImageId);
052                    sb.append(", priority=");
053                    sb.append(priority);
054                    sb.append("}");
055    
056                    return sb.toString();
057            }
058    
059            @Override
060            public SCProductScreenshot toEntityModel() {
061                    SCProductScreenshotImpl scProductScreenshotImpl = new SCProductScreenshotImpl();
062    
063                    scProductScreenshotImpl.setProductScreenshotId(productScreenshotId);
064                    scProductScreenshotImpl.setCompanyId(companyId);
065                    scProductScreenshotImpl.setGroupId(groupId);
066                    scProductScreenshotImpl.setProductEntryId(productEntryId);
067                    scProductScreenshotImpl.setThumbnailId(thumbnailId);
068                    scProductScreenshotImpl.setFullImageId(fullImageId);
069                    scProductScreenshotImpl.setPriority(priority);
070    
071                    scProductScreenshotImpl.resetOriginalValues();
072    
073                    return scProductScreenshotImpl;
074            }
075    
076            @Override
077            public void readExternal(ObjectInput objectInput) throws IOException {
078                    productScreenshotId = objectInput.readLong();
079                    companyId = objectInput.readLong();
080                    groupId = objectInput.readLong();
081                    productEntryId = objectInput.readLong();
082                    thumbnailId = objectInput.readLong();
083                    fullImageId = objectInput.readLong();
084                    priority = objectInput.readInt();
085            }
086    
087            @Override
088            public void writeExternal(ObjectOutput objectOutput)
089                    throws IOException {
090                    objectOutput.writeLong(productScreenshotId);
091                    objectOutput.writeLong(companyId);
092                    objectOutput.writeLong(groupId);
093                    objectOutput.writeLong(productEntryId);
094                    objectOutput.writeLong(thumbnailId);
095                    objectOutput.writeLong(fullImageId);
096                    objectOutput.writeInt(priority);
097            }
098    
099            public long productScreenshotId;
100            public long companyId;
101            public long groupId;
102            public long productEntryId;
103            public long thumbnailId;
104            public long fullImageId;
105            public int priority;
106    }