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