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