001
014
015 package com.liferay.portlet.softwarecatalog.model.impl;
016
017 import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018 import com.liferay.portal.kernel.util.GetterUtil;
019 import com.liferay.portal.kernel.util.ProxyUtil;
020 import com.liferay.portal.kernel.util.StringBundler;
021 import com.liferay.portal.model.CacheModel;
022 import com.liferay.portal.model.impl.BaseModelImpl;
023 import com.liferay.portal.service.ServiceContext;
024
025 import com.liferay.portlet.expando.model.ExpandoBridge;
026 import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
027 import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
028 import com.liferay.portlet.softwarecatalog.model.SCProductScreenshotModel;
029
030 import java.io.Serializable;
031
032 import java.sql.Types;
033
034
047 public class SCProductScreenshotModelImpl extends BaseModelImpl<SCProductScreenshot>
048 implements SCProductScreenshotModel {
049
054 public static final String TABLE_NAME = "SCProductScreenshot";
055 public static final Object[][] TABLE_COLUMNS = {
056 { "productScreenshotId", Types.BIGINT },
057 { "companyId", Types.BIGINT },
058 { "groupId", Types.BIGINT },
059 { "productEntryId", Types.BIGINT },
060 { "thumbnailId", Types.BIGINT },
061 { "fullImageId", Types.BIGINT },
062 { "priority", Types.INTEGER }
063 };
064 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)";
065 public static final String TABLE_SQL_DROP = "drop table SCProductScreenshot";
066 public static final String ORDER_BY_JPQL = " ORDER BY scProductScreenshot.productEntryId ASC, scProductScreenshot.priority ASC";
067 public static final String ORDER_BY_SQL = " ORDER BY SCProductScreenshot.productEntryId ASC, SCProductScreenshot.priority ASC";
068 public static final String DATA_SOURCE = "liferayDataSource";
069 public static final String SESSION_FACTORY = "liferaySessionFactory";
070 public static final String TX_MANAGER = "liferayTransactionManager";
071 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
072 "value.object.entity.cache.enabled.com.liferay.portlet.softwarecatalog.model.SCProductScreenshot"),
073 true);
074 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
075 "value.object.finder.cache.enabled.com.liferay.portlet.softwarecatalog.model.SCProductScreenshot"),
076 true);
077 public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
078 "value.object.column.bitmask.enabled.com.liferay.portlet.softwarecatalog.model.SCProductScreenshot"),
079 true);
080 public static long FULLIMAGEID_COLUMN_BITMASK = 1L;
081 public static long PRIORITY_COLUMN_BITMASK = 2L;
082 public static long PRODUCTENTRYID_COLUMN_BITMASK = 4L;
083 public static long THUMBNAILID_COLUMN_BITMASK = 8L;
084 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
085 "lock.expiration.time.com.liferay.portlet.softwarecatalog.model.SCProductScreenshot"));
086
087 public SCProductScreenshotModelImpl() {
088 }
089
090 public long getPrimaryKey() {
091 return _productScreenshotId;
092 }
093
094 public void setPrimaryKey(long primaryKey) {
095 setProductScreenshotId(primaryKey);
096 }
097
098 public Serializable getPrimaryKeyObj() {
099 return new Long(_productScreenshotId);
100 }
101
102 public void setPrimaryKeyObj(Serializable primaryKeyObj) {
103 setPrimaryKey(((Long)primaryKeyObj).longValue());
104 }
105
106 public Class<?> getModelClass() {
107 return SCProductScreenshot.class;
108 }
109
110 public String getModelClassName() {
111 return SCProductScreenshot.class.getName();
112 }
113
114 public long getProductScreenshotId() {
115 return _productScreenshotId;
116 }
117
118 public void setProductScreenshotId(long productScreenshotId) {
119 _productScreenshotId = productScreenshotId;
120 }
121
122 public long getCompanyId() {
123 return _companyId;
124 }
125
126 public void setCompanyId(long companyId) {
127 _companyId = companyId;
128 }
129
130 public long getGroupId() {
131 return _groupId;
132 }
133
134 public void setGroupId(long groupId) {
135 _groupId = groupId;
136 }
137
138 public long getProductEntryId() {
139 return _productEntryId;
140 }
141
142 public void setProductEntryId(long productEntryId) {
143 _columnBitmask = -1L;
144
145 if (!_setOriginalProductEntryId) {
146 _setOriginalProductEntryId = true;
147
148 _originalProductEntryId = _productEntryId;
149 }
150
151 _productEntryId = productEntryId;
152 }
153
154 public long getOriginalProductEntryId() {
155 return _originalProductEntryId;
156 }
157
158 public long getThumbnailId() {
159 return _thumbnailId;
160 }
161
162 public void setThumbnailId(long thumbnailId) {
163 _columnBitmask |= THUMBNAILID_COLUMN_BITMASK;
164
165 if (!_setOriginalThumbnailId) {
166 _setOriginalThumbnailId = true;
167
168 _originalThumbnailId = _thumbnailId;
169 }
170
171 _thumbnailId = thumbnailId;
172 }
173
174 public long getOriginalThumbnailId() {
175 return _originalThumbnailId;
176 }
177
178 public long getFullImageId() {
179 return _fullImageId;
180 }
181
182 public void setFullImageId(long fullImageId) {
183 _columnBitmask |= FULLIMAGEID_COLUMN_BITMASK;
184
185 if (!_setOriginalFullImageId) {
186 _setOriginalFullImageId = true;
187
188 _originalFullImageId = _fullImageId;
189 }
190
191 _fullImageId = fullImageId;
192 }
193
194 public long getOriginalFullImageId() {
195 return _originalFullImageId;
196 }
197
198 public int getPriority() {
199 return _priority;
200 }
201
202 public void setPriority(int priority) {
203 _columnBitmask = -1L;
204
205 if (!_setOriginalPriority) {
206 _setOriginalPriority = true;
207
208 _originalPriority = _priority;
209 }
210
211 _priority = priority;
212 }
213
214 public int getOriginalPriority() {
215 return _originalPriority;
216 }
217
218 public long getColumnBitmask() {
219 return _columnBitmask;
220 }
221
222 @Override
223 public SCProductScreenshot toEscapedModel() {
224 if (_escapedModelProxy == null) {
225 _escapedModelProxy = (SCProductScreenshot)ProxyUtil.newProxyInstance(_classLoader,
226 _escapedModelProxyInterfaces,
227 new AutoEscapeBeanHandler(this));
228 }
229
230 return _escapedModelProxy;
231 }
232
233 @Override
234 public ExpandoBridge getExpandoBridge() {
235 if (_expandoBridge == null) {
236 _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
237 SCProductScreenshot.class.getName(), getPrimaryKey());
238 }
239
240 return _expandoBridge;
241 }
242
243 @Override
244 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
245 getExpandoBridge().setAttributes(serviceContext);
246 }
247
248 @Override
249 public Object clone() {
250 SCProductScreenshotImpl scProductScreenshotImpl = new SCProductScreenshotImpl();
251
252 scProductScreenshotImpl.setProductScreenshotId(getProductScreenshotId());
253 scProductScreenshotImpl.setCompanyId(getCompanyId());
254 scProductScreenshotImpl.setGroupId(getGroupId());
255 scProductScreenshotImpl.setProductEntryId(getProductEntryId());
256 scProductScreenshotImpl.setThumbnailId(getThumbnailId());
257 scProductScreenshotImpl.setFullImageId(getFullImageId());
258 scProductScreenshotImpl.setPriority(getPriority());
259
260 scProductScreenshotImpl.resetOriginalValues();
261
262 return scProductScreenshotImpl;
263 }
264
265 public int compareTo(SCProductScreenshot scProductScreenshot) {
266 int value = 0;
267
268 if (getProductEntryId() < scProductScreenshot.getProductEntryId()) {
269 value = -1;
270 }
271 else if (getProductEntryId() > scProductScreenshot.getProductEntryId()) {
272 value = 1;
273 }
274 else {
275 value = 0;
276 }
277
278 if (value != 0) {
279 return value;
280 }
281
282 if (getPriority() < scProductScreenshot.getPriority()) {
283 value = -1;
284 }
285 else if (getPriority() > scProductScreenshot.getPriority()) {
286 value = 1;
287 }
288 else {
289 value = 0;
290 }
291
292 if (value != 0) {
293 return value;
294 }
295
296 return 0;
297 }
298
299 @Override
300 public boolean equals(Object obj) {
301 if (obj == null) {
302 return false;
303 }
304
305 SCProductScreenshot scProductScreenshot = null;
306
307 try {
308 scProductScreenshot = (SCProductScreenshot)obj;
309 }
310 catch (ClassCastException cce) {
311 return false;
312 }
313
314 long primaryKey = scProductScreenshot.getPrimaryKey();
315
316 if (getPrimaryKey() == primaryKey) {
317 return true;
318 }
319 else {
320 return false;
321 }
322 }
323
324 @Override
325 public int hashCode() {
326 return (int)getPrimaryKey();
327 }
328
329 @Override
330 public void resetOriginalValues() {
331 SCProductScreenshotModelImpl scProductScreenshotModelImpl = this;
332
333 scProductScreenshotModelImpl._originalProductEntryId = scProductScreenshotModelImpl._productEntryId;
334
335 scProductScreenshotModelImpl._setOriginalProductEntryId = false;
336
337 scProductScreenshotModelImpl._originalThumbnailId = scProductScreenshotModelImpl._thumbnailId;
338
339 scProductScreenshotModelImpl._setOriginalThumbnailId = false;
340
341 scProductScreenshotModelImpl._originalFullImageId = scProductScreenshotModelImpl._fullImageId;
342
343 scProductScreenshotModelImpl._setOriginalFullImageId = false;
344
345 scProductScreenshotModelImpl._originalPriority = scProductScreenshotModelImpl._priority;
346
347 scProductScreenshotModelImpl._setOriginalPriority = false;
348
349 scProductScreenshotModelImpl._columnBitmask = 0;
350 }
351
352 @Override
353 public CacheModel<SCProductScreenshot> toCacheModel() {
354 SCProductScreenshotCacheModel scProductScreenshotCacheModel = new SCProductScreenshotCacheModel();
355
356 scProductScreenshotCacheModel.productScreenshotId = getProductScreenshotId();
357
358 scProductScreenshotCacheModel.companyId = getCompanyId();
359
360 scProductScreenshotCacheModel.groupId = getGroupId();
361
362 scProductScreenshotCacheModel.productEntryId = getProductEntryId();
363
364 scProductScreenshotCacheModel.thumbnailId = getThumbnailId();
365
366 scProductScreenshotCacheModel.fullImageId = getFullImageId();
367
368 scProductScreenshotCacheModel.priority = getPriority();
369
370 return scProductScreenshotCacheModel;
371 }
372
373 @Override
374 public String toString() {
375 StringBundler sb = new StringBundler(15);
376
377 sb.append("{productScreenshotId=");
378 sb.append(getProductScreenshotId());
379 sb.append(", companyId=");
380 sb.append(getCompanyId());
381 sb.append(", groupId=");
382 sb.append(getGroupId());
383 sb.append(", productEntryId=");
384 sb.append(getProductEntryId());
385 sb.append(", thumbnailId=");
386 sb.append(getThumbnailId());
387 sb.append(", fullImageId=");
388 sb.append(getFullImageId());
389 sb.append(", priority=");
390 sb.append(getPriority());
391 sb.append("}");
392
393 return sb.toString();
394 }
395
396 public String toXmlString() {
397 StringBundler sb = new StringBundler(25);
398
399 sb.append("<model><model-name>");
400 sb.append(
401 "com.liferay.portlet.softwarecatalog.model.SCProductScreenshot");
402 sb.append("</model-name>");
403
404 sb.append(
405 "<column><column-name>productScreenshotId</column-name><column-value><![CDATA[");
406 sb.append(getProductScreenshotId());
407 sb.append("]]></column-value></column>");
408 sb.append(
409 "<column><column-name>companyId</column-name><column-value><![CDATA[");
410 sb.append(getCompanyId());
411 sb.append("]]></column-value></column>");
412 sb.append(
413 "<column><column-name>groupId</column-name><column-value><![CDATA[");
414 sb.append(getGroupId());
415 sb.append("]]></column-value></column>");
416 sb.append(
417 "<column><column-name>productEntryId</column-name><column-value><![CDATA[");
418 sb.append(getProductEntryId());
419 sb.append("]]></column-value></column>");
420 sb.append(
421 "<column><column-name>thumbnailId</column-name><column-value><![CDATA[");
422 sb.append(getThumbnailId());
423 sb.append("]]></column-value></column>");
424 sb.append(
425 "<column><column-name>fullImageId</column-name><column-value><![CDATA[");
426 sb.append(getFullImageId());
427 sb.append("]]></column-value></column>");
428 sb.append(
429 "<column><column-name>priority</column-name><column-value><![CDATA[");
430 sb.append(getPriority());
431 sb.append("]]></column-value></column>");
432
433 sb.append("</model>");
434
435 return sb.toString();
436 }
437
438 private static ClassLoader _classLoader = SCProductScreenshot.class.getClassLoader();
439 private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
440 SCProductScreenshot.class
441 };
442 private long _productScreenshotId;
443 private long _companyId;
444 private long _groupId;
445 private long _productEntryId;
446 private long _originalProductEntryId;
447 private boolean _setOriginalProductEntryId;
448 private long _thumbnailId;
449 private long _originalThumbnailId;
450 private boolean _setOriginalThumbnailId;
451 private long _fullImageId;
452 private long _originalFullImageId;
453 private boolean _setOriginalFullImageId;
454 private int _priority;
455 private int _originalPriority;
456 private boolean _setOriginalPriority;
457 private transient ExpandoBridge _expandoBridge;
458 private long _columnBitmask;
459 private SCProductScreenshot _escapedModelProxy;
460 }