1
22
23 package com.liferay.portlet.softwarecatalog.model.impl;
24
25 import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26 import com.liferay.portal.kernel.util.GetterUtil;
27 import com.liferay.portal.model.impl.BaseModelImpl;
28 import com.liferay.portal.util.PropsUtil;
29
30 import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
31 import com.liferay.portlet.softwarecatalog.model.SCProductScreenshotSoap;
32
33 import java.io.Serializable;
34
35 import java.lang.reflect.Proxy;
36
37 import java.sql.Types;
38
39 import java.util.ArrayList;
40 import java.util.List;
41
42
62 public class SCProductScreenshotModelImpl extends BaseModelImpl {
63 public static final String TABLE_NAME = "SCProductScreenshot";
64 public static final Object[][] TABLE_COLUMNS = {
65 { "productScreenshotId", new Integer(Types.BIGINT) },
66
67
68 { "companyId", new Integer(Types.BIGINT) },
69
70
71 { "groupId", new Integer(Types.BIGINT) },
72
73
74 { "productEntryId", new Integer(Types.BIGINT) },
75
76
77 { "thumbnailId", new Integer(Types.BIGINT) },
78
79
80 { "fullImageId", new Integer(Types.BIGINT) },
81
82
83 { "priority", new Integer(Types.INTEGER) }
84 };
85 public static final String TABLE_SQL_CREATE = "create table SCProductScreenshot (productScreenshotId LONG not null primary key,companyId LONG,groupId LONG,productEntryId LONG,thumbnailId LONG,fullImageId LONG,priority INTEGER)";
86 public static final String TABLE_SQL_DROP = "drop table SCProductScreenshot";
87 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(PropsUtil.get(
88 "value.object.finder.cache.enabled.com.liferay.portlet.softwarecatalog.model.SCProductScreenshot"),
89 true);
90
91 public static SCProductScreenshot toModel(SCProductScreenshotSoap soapModel) {
92 SCProductScreenshot model = new SCProductScreenshotImpl();
93
94 model.setProductScreenshotId(soapModel.getProductScreenshotId());
95 model.setCompanyId(soapModel.getCompanyId());
96 model.setGroupId(soapModel.getGroupId());
97 model.setProductEntryId(soapModel.getProductEntryId());
98 model.setThumbnailId(soapModel.getThumbnailId());
99 model.setFullImageId(soapModel.getFullImageId());
100 model.setPriority(soapModel.getPriority());
101
102 return model;
103 }
104
105 public static List<SCProductScreenshot> toModels(
106 SCProductScreenshotSoap[] soapModels) {
107 List<SCProductScreenshot> models = new ArrayList<SCProductScreenshot>(soapModels.length);
108
109 for (SCProductScreenshotSoap soapModel : soapModels) {
110 models.add(toModel(soapModel));
111 }
112
113 return models;
114 }
115
116 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
117 "lock.expiration.time.com.liferay.portlet.softwarecatalog.model.SCProductScreenshot"));
118
119 public SCProductScreenshotModelImpl() {
120 }
121
122 public long getPrimaryKey() {
123 return _productScreenshotId;
124 }
125
126 public void setPrimaryKey(long pk) {
127 setProductScreenshotId(pk);
128 }
129
130 public Serializable getPrimaryKeyObj() {
131 return new Long(_productScreenshotId);
132 }
133
134 public long getProductScreenshotId() {
135 return _productScreenshotId;
136 }
137
138 public void setProductScreenshotId(long productScreenshotId) {
139 if (productScreenshotId != _productScreenshotId) {
140 _productScreenshotId = productScreenshotId;
141 }
142 }
143
144 public long getCompanyId() {
145 return _companyId;
146 }
147
148 public void setCompanyId(long companyId) {
149 if (companyId != _companyId) {
150 _companyId = companyId;
151 }
152 }
153
154 public long getGroupId() {
155 return _groupId;
156 }
157
158 public void setGroupId(long groupId) {
159 if (groupId != _groupId) {
160 _groupId = groupId;
161 }
162 }
163
164 public long getProductEntryId() {
165 return _productEntryId;
166 }
167
168 public void setProductEntryId(long productEntryId) {
169 if (productEntryId != _productEntryId) {
170 _productEntryId = productEntryId;
171 }
172 }
173
174 public long getThumbnailId() {
175 return _thumbnailId;
176 }
177
178 public void setThumbnailId(long thumbnailId) {
179 if (thumbnailId != _thumbnailId) {
180 _thumbnailId = thumbnailId;
181 }
182 }
183
184 public long getFullImageId() {
185 return _fullImageId;
186 }
187
188 public void setFullImageId(long fullImageId) {
189 if (fullImageId != _fullImageId) {
190 _fullImageId = fullImageId;
191 }
192 }
193
194 public int getPriority() {
195 return _priority;
196 }
197
198 public void setPriority(int priority) {
199 if (priority != _priority) {
200 _priority = priority;
201 }
202 }
203
204 public SCProductScreenshot toEscapedModel() {
205 if (isEscapedModel()) {
206 return (SCProductScreenshot)this;
207 }
208 else {
209 SCProductScreenshot model = new SCProductScreenshotImpl();
210
211 model.setEscapedModel(true);
212
213 model.setProductScreenshotId(getProductScreenshotId());
214 model.setCompanyId(getCompanyId());
215 model.setGroupId(getGroupId());
216 model.setProductEntryId(getProductEntryId());
217 model.setThumbnailId(getThumbnailId());
218 model.setFullImageId(getFullImageId());
219 model.setPriority(getPriority());
220
221 model = (SCProductScreenshot)Proxy.newProxyInstance(SCProductScreenshot.class.getClassLoader(),
222 new Class[] { SCProductScreenshot.class },
223 new ReadOnlyBeanHandler(model));
224
225 return model;
226 }
227 }
228
229 public Object clone() {
230 SCProductScreenshotImpl clone = new SCProductScreenshotImpl();
231
232 clone.setProductScreenshotId(getProductScreenshotId());
233 clone.setCompanyId(getCompanyId());
234 clone.setGroupId(getGroupId());
235 clone.setProductEntryId(getProductEntryId());
236 clone.setThumbnailId(getThumbnailId());
237 clone.setFullImageId(getFullImageId());
238 clone.setPriority(getPriority());
239
240 return clone;
241 }
242
243 public int compareTo(Object obj) {
244 if (obj == null) {
245 return -1;
246 }
247
248 SCProductScreenshotImpl scProductScreenshot = (SCProductScreenshotImpl)obj;
249
250 int value = 0;
251
252 if (getProductEntryId() < scProductScreenshot.getProductEntryId()) {
253 value = -1;
254 }
255 else if (getProductEntryId() > scProductScreenshot.getProductEntryId()) {
256 value = 1;
257 }
258 else {
259 value = 0;
260 }
261
262 if (value != 0) {
263 return value;
264 }
265
266 if (getPriority() < scProductScreenshot.getPriority()) {
267 value = -1;
268 }
269 else if (getPriority() > scProductScreenshot.getPriority()) {
270 value = 1;
271 }
272 else {
273 value = 0;
274 }
275
276 if (value != 0) {
277 return value;
278 }
279
280 return 0;
281 }
282
283 public boolean equals(Object obj) {
284 if (obj == null) {
285 return false;
286 }
287
288 SCProductScreenshotImpl scProductScreenshot = null;
289
290 try {
291 scProductScreenshot = (SCProductScreenshotImpl)obj;
292 }
293 catch (ClassCastException cce) {
294 return false;
295 }
296
297 long pk = scProductScreenshot.getPrimaryKey();
298
299 if (getPrimaryKey() == pk) {
300 return true;
301 }
302 else {
303 return false;
304 }
305 }
306
307 public int hashCode() {
308 return (int)getPrimaryKey();
309 }
310
311 private long _productScreenshotId;
312 private long _companyId;
313 private long _groupId;
314 private long _productEntryId;
315 private long _thumbnailId;
316 private long _fullImageId;
317 private int _priority;
318 }