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.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            public SCProductScreenshot toEntityModel() {
060                    SCProductScreenshotImpl scProductScreenshotImpl = new SCProductScreenshotImpl();
061    
062                    scProductScreenshotImpl.setProductScreenshotId(productScreenshotId);
063                    scProductScreenshotImpl.setCompanyId(companyId);
064                    scProductScreenshotImpl.setGroupId(groupId);
065                    scProductScreenshotImpl.setProductEntryId(productEntryId);
066                    scProductScreenshotImpl.setThumbnailId(thumbnailId);
067                    scProductScreenshotImpl.setFullImageId(fullImageId);
068                    scProductScreenshotImpl.setPriority(priority);
069    
070                    scProductScreenshotImpl.resetOriginalValues();
071    
072                    return scProductScreenshotImpl;
073            }
074    
075            public void readExternal(ObjectInput objectInput) throws IOException {
076                    productScreenshotId = objectInput.readLong();
077                    companyId = objectInput.readLong();
078                    groupId = objectInput.readLong();
079                    productEntryId = objectInput.readLong();
080                    thumbnailId = objectInput.readLong();
081                    fullImageId = objectInput.readLong();
082                    priority = objectInput.readInt();
083            }
084    
085            public void writeExternal(ObjectOutput objectOutput)
086                    throws IOException {
087                    objectOutput.writeLong(productScreenshotId);
088                    objectOutput.writeLong(companyId);
089                    objectOutput.writeLong(groupId);
090                    objectOutput.writeLong(productEntryId);
091                    objectOutput.writeLong(thumbnailId);
092                    objectOutput.writeLong(fullImageId);
093                    objectOutput.writeInt(priority);
094            }
095    
096            public long productScreenshotId;
097            public long companyId;
098            public long groupId;
099            public long productEntryId;
100            public long thumbnailId;
101            public long fullImageId;
102            public int priority;
103    }