1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.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.OrgLabor;
28  import com.liferay.portal.util.PropsUtil;
29  
30  import java.io.Serializable;
31  
32  import java.lang.reflect.Proxy;
33  
34  import java.sql.Types;
35  
36  /**
37   * <a href="OrgLaborModelImpl.java.html"><b><i>View Source</i></b></a>
38   *
39   * <p>
40   * ServiceBuilder generated this class. Modifications in this class will be
41   * overwritten the next time is generated.
42   * </p>
43   *
44   * <p>
45   * This class is a model that represents the <code>OrgLabor</code> table
46   * in the database.
47   * </p>
48   *
49   * @author Brian Wing Shun Chan
50   *
51   * @see com.liferay.portal.service.model.OrgLabor
52   * @see com.liferay.portal.service.model.OrgLaborModel
53   * @see com.liferay.portal.service.model.impl.OrgLaborImpl
54   *
55   */
56  public class OrgLaborModelImpl extends BaseModelImpl {
57      public static final String TABLE_NAME = "OrgLabor";
58      public static final Object[][] TABLE_COLUMNS = {
59              { "orgLaborId", new Integer(Types.BIGINT) },
60              
61  
62              { "organizationId", new Integer(Types.BIGINT) },
63              
64  
65              { "typeId", new Integer(Types.INTEGER) },
66              
67  
68              { "sunOpen", new Integer(Types.INTEGER) },
69              
70  
71              { "sunClose", new Integer(Types.INTEGER) },
72              
73  
74              { "monOpen", new Integer(Types.INTEGER) },
75              
76  
77              { "monClose", new Integer(Types.INTEGER) },
78              
79  
80              { "tueOpen", new Integer(Types.INTEGER) },
81              
82  
83              { "tueClose", new Integer(Types.INTEGER) },
84              
85  
86              { "wedOpen", new Integer(Types.INTEGER) },
87              
88  
89              { "wedClose", new Integer(Types.INTEGER) },
90              
91  
92              { "thuOpen", new Integer(Types.INTEGER) },
93              
94  
95              { "thuClose", new Integer(Types.INTEGER) },
96              
97  
98              { "friOpen", new Integer(Types.INTEGER) },
99              
100 
101             { "friClose", new Integer(Types.INTEGER) },
102             
103 
104             { "satOpen", new Integer(Types.INTEGER) },
105             
106 
107             { "satClose", new Integer(Types.INTEGER) }
108         };
109     public static final String TABLE_SQL_CREATE = "create table OrgLabor (orgLaborId LONG not null primary key,organizationId LONG,typeId INTEGER,sunOpen INTEGER,sunClose INTEGER,monOpen INTEGER,monClose INTEGER,tueOpen INTEGER,tueClose INTEGER,wedOpen INTEGER,wedClose INTEGER,thuOpen INTEGER,thuClose INTEGER,friOpen INTEGER,friClose INTEGER,satOpen INTEGER,satClose INTEGER)";
110     public static final String TABLE_SQL_DROP = "drop table OrgLabor";
111     public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(PropsUtil.get(
112                 "value.object.finder.cache.enabled.com.liferay.portal.model.OrgLabor"),
113             true);
114     public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
115                 "lock.expiration.time.com.liferay.portal.model.OrgLabor"));
116 
117     public OrgLaborModelImpl() {
118     }
119 
120     public long getPrimaryKey() {
121         return _orgLaborId;
122     }
123 
124     public void setPrimaryKey(long pk) {
125         setOrgLaborId(pk);
126     }
127 
128     public Serializable getPrimaryKeyObj() {
129         return new Long(_orgLaborId);
130     }
131 
132     public long getOrgLaborId() {
133         return _orgLaborId;
134     }
135 
136     public void setOrgLaborId(long orgLaborId) {
137         if (orgLaborId != _orgLaborId) {
138             _orgLaborId = orgLaborId;
139         }
140     }
141 
142     public long getOrganizationId() {
143         return _organizationId;
144     }
145 
146     public void setOrganizationId(long organizationId) {
147         if (organizationId != _organizationId) {
148             _organizationId = organizationId;
149         }
150     }
151 
152     public int getTypeId() {
153         return _typeId;
154     }
155 
156     public void setTypeId(int typeId) {
157         if (typeId != _typeId) {
158             _typeId = typeId;
159         }
160     }
161 
162     public int getSunOpen() {
163         return _sunOpen;
164     }
165 
166     public void setSunOpen(int sunOpen) {
167         if (sunOpen != _sunOpen) {
168             _sunOpen = sunOpen;
169         }
170     }
171 
172     public int getSunClose() {
173         return _sunClose;
174     }
175 
176     public void setSunClose(int sunClose) {
177         if (sunClose != _sunClose) {
178             _sunClose = sunClose;
179         }
180     }
181 
182     public int getMonOpen() {
183         return _monOpen;
184     }
185 
186     public void setMonOpen(int monOpen) {
187         if (monOpen != _monOpen) {
188             _monOpen = monOpen;
189         }
190     }
191 
192     public int getMonClose() {
193         return _monClose;
194     }
195 
196     public void setMonClose(int monClose) {
197         if (monClose != _monClose) {
198             _monClose = monClose;
199         }
200     }
201 
202     public int getTueOpen() {
203         return _tueOpen;
204     }
205 
206     public void setTueOpen(int tueOpen) {
207         if (tueOpen != _tueOpen) {
208             _tueOpen = tueOpen;
209         }
210     }
211 
212     public int getTueClose() {
213         return _tueClose;
214     }
215 
216     public void setTueClose(int tueClose) {
217         if (tueClose != _tueClose) {
218             _tueClose = tueClose;
219         }
220     }
221 
222     public int getWedOpen() {
223         return _wedOpen;
224     }
225 
226     public void setWedOpen(int wedOpen) {
227         if (wedOpen != _wedOpen) {
228             _wedOpen = wedOpen;
229         }
230     }
231 
232     public int getWedClose() {
233         return _wedClose;
234     }
235 
236     public void setWedClose(int wedClose) {
237         if (wedClose != _wedClose) {
238             _wedClose = wedClose;
239         }
240     }
241 
242     public int getThuOpen() {
243         return _thuOpen;
244     }
245 
246     public void setThuOpen(int thuOpen) {
247         if (thuOpen != _thuOpen) {
248             _thuOpen = thuOpen;
249         }
250     }
251 
252     public int getThuClose() {
253         return _thuClose;
254     }
255 
256     public void setThuClose(int thuClose) {
257         if (thuClose != _thuClose) {
258             _thuClose = thuClose;
259         }
260     }
261 
262     public int getFriOpen() {
263         return _friOpen;
264     }
265 
266     public void setFriOpen(int friOpen) {
267         if (friOpen != _friOpen) {
268             _friOpen = friOpen;
269         }
270     }
271 
272     public int getFriClose() {
273         return _friClose;
274     }
275 
276     public void setFriClose(int friClose) {
277         if (friClose != _friClose) {
278             _friClose = friClose;
279         }
280     }
281 
282     public int getSatOpen() {
283         return _satOpen;
284     }
285 
286     public void setSatOpen(int satOpen) {
287         if (satOpen != _satOpen) {
288             _satOpen = satOpen;
289         }
290     }
291 
292     public int getSatClose() {
293         return _satClose;
294     }
295 
296     public void setSatClose(int satClose) {
297         if (satClose != _satClose) {
298             _satClose = satClose;
299         }
300     }
301 
302     public OrgLabor toEscapedModel() {
303         if (isEscapedModel()) {
304             return (OrgLabor)this;
305         }
306         else {
307             OrgLabor model = new OrgLaborImpl();
308 
309             model.setEscapedModel(true);
310 
311             model.setOrgLaborId(getOrgLaborId());
312             model.setOrganizationId(getOrganizationId());
313             model.setTypeId(getTypeId());
314             model.setSunOpen(getSunOpen());
315             model.setSunClose(getSunClose());
316             model.setMonOpen(getMonOpen());
317             model.setMonClose(getMonClose());
318             model.setTueOpen(getTueOpen());
319             model.setTueClose(getTueClose());
320             model.setWedOpen(getWedOpen());
321             model.setWedClose(getWedClose());
322             model.setThuOpen(getThuOpen());
323             model.setThuClose(getThuClose());
324             model.setFriOpen(getFriOpen());
325             model.setFriClose(getFriClose());
326             model.setSatOpen(getSatOpen());
327             model.setSatClose(getSatClose());
328 
329             model = (OrgLabor)Proxy.newProxyInstance(OrgLabor.class.getClassLoader(),
330                     new Class[] { OrgLabor.class },
331                     new ReadOnlyBeanHandler(model));
332 
333             return model;
334         }
335     }
336 
337     public Object clone() {
338         OrgLaborImpl clone = new OrgLaborImpl();
339 
340         clone.setOrgLaborId(getOrgLaborId());
341         clone.setOrganizationId(getOrganizationId());
342         clone.setTypeId(getTypeId());
343         clone.setSunOpen(getSunOpen());
344         clone.setSunClose(getSunClose());
345         clone.setMonOpen(getMonOpen());
346         clone.setMonClose(getMonClose());
347         clone.setTueOpen(getTueOpen());
348         clone.setTueClose(getTueClose());
349         clone.setWedOpen(getWedOpen());
350         clone.setWedClose(getWedClose());
351         clone.setThuOpen(getThuOpen());
352         clone.setThuClose(getThuClose());
353         clone.setFriOpen(getFriOpen());
354         clone.setFriClose(getFriClose());
355         clone.setSatOpen(getSatOpen());
356         clone.setSatClose(getSatClose());
357 
358         return clone;
359     }
360 
361     public int compareTo(Object obj) {
362         if (obj == null) {
363             return -1;
364         }
365 
366         OrgLaborImpl orgLabor = (OrgLaborImpl)obj;
367 
368         int value = 0;
369 
370         if (getOrganizationId() < orgLabor.getOrganizationId()) {
371             value = -1;
372         }
373         else if (getOrganizationId() > orgLabor.getOrganizationId()) {
374             value = 1;
375         }
376         else {
377             value = 0;
378         }
379 
380         if (value != 0) {
381             return value;
382         }
383 
384         if (getTypeId() < orgLabor.getTypeId()) {
385             value = -1;
386         }
387         else if (getTypeId() > orgLabor.getTypeId()) {
388             value = 1;
389         }
390         else {
391             value = 0;
392         }
393 
394         if (value != 0) {
395             return value;
396         }
397 
398         return 0;
399     }
400 
401     public boolean equals(Object obj) {
402         if (obj == null) {
403             return false;
404         }
405 
406         OrgLaborImpl orgLabor = null;
407 
408         try {
409             orgLabor = (OrgLaborImpl)obj;
410         }
411         catch (ClassCastException cce) {
412             return false;
413         }
414 
415         long pk = orgLabor.getPrimaryKey();
416 
417         if (getPrimaryKey() == pk) {
418             return true;
419         }
420         else {
421             return false;
422         }
423     }
424 
425     public int hashCode() {
426         return (int)getPrimaryKey();
427     }
428 
429     private long _orgLaborId;
430     private long _organizationId;
431     private int _typeId;
432     private int _sunOpen;
433     private int _sunClose;
434     private int _monOpen;
435     private int _monClose;
436     private int _tueOpen;
437     private int _tueClose;
438     private int _wedOpen;
439     private int _wedClose;
440     private int _thuOpen;
441     private int _thuClose;
442     private int _friOpen;
443     private int _friClose;
444     private int _satOpen;
445     private int _satClose;
446 }