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.model.OrgLaborSoap;
29  
30  import java.io.Serializable;
31  
32  import java.lang.reflect.Proxy;
33  
34  import java.sql.Types;
35  
36  import java.util.ArrayList;
37  import java.util.List;
38  
39  /**
40   * <a href="OrgLaborModelImpl.java.html"><b><i>View Source</i></b></a>
41   *
42   * <p>
43   * ServiceBuilder generated this class. Modifications in this class will be
44   * overwritten the next time is generated.
45   * </p>
46   *
47   * <p>
48   * This class is a model that represents the <code>OrgLabor</code> table
49   * in the database.
50   * </p>
51   *
52   * @author Brian Wing Shun Chan
53   *
54   * @see com.liferay.portal.service.model.OrgLabor
55   * @see com.liferay.portal.service.model.OrgLaborModel
56   * @see com.liferay.portal.service.model.impl.OrgLaborImpl
57   *
58   */
59  public class OrgLaborModelImpl extends BaseModelImpl {
60      public static final String TABLE_NAME = "OrgLabor";
61      public static final Object[][] TABLE_COLUMNS = {
62              { "orgLaborId", new Integer(Types.BIGINT) },
63              
64  
65              { "organizationId", new Integer(Types.BIGINT) },
66              
67  
68              { "typeId", new Integer(Types.INTEGER) },
69              
70  
71              { "sunOpen", new Integer(Types.INTEGER) },
72              
73  
74              { "sunClose", new Integer(Types.INTEGER) },
75              
76  
77              { "monOpen", new Integer(Types.INTEGER) },
78              
79  
80              { "monClose", new Integer(Types.INTEGER) },
81              
82  
83              { "tueOpen", new Integer(Types.INTEGER) },
84              
85  
86              { "tueClose", new Integer(Types.INTEGER) },
87              
88  
89              { "wedOpen", new Integer(Types.INTEGER) },
90              
91  
92              { "wedClose", new Integer(Types.INTEGER) },
93              
94  
95              { "thuOpen", new Integer(Types.INTEGER) },
96              
97  
98              { "thuClose", new Integer(Types.INTEGER) },
99              
100 
101             { "friOpen", new Integer(Types.INTEGER) },
102             
103 
104             { "friClose", new Integer(Types.INTEGER) },
105             
106 
107             { "satOpen", new Integer(Types.INTEGER) },
108             
109 
110             { "satClose", new Integer(Types.INTEGER) }
111         };
112     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)";
113     public static final String TABLE_SQL_DROP = "drop table OrgLabor";
114     public static final String DATA_SOURCE = "liferayDataSource";
115     public static final String SESSION_FACTORY = "liferaySessionFactory";
116     public static final String TX_MANAGER = "liferayTransactionManager";
117     public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
118                 "value.object.finder.cache.enabled.com.liferay.portal.model.OrgLabor"),
119             true);
120 
121     public static OrgLabor toModel(OrgLaborSoap soapModel) {
122         OrgLabor model = new OrgLaborImpl();
123 
124         model.setOrgLaborId(soapModel.getOrgLaborId());
125         model.setOrganizationId(soapModel.getOrganizationId());
126         model.setTypeId(soapModel.getTypeId());
127         model.setSunOpen(soapModel.getSunOpen());
128         model.setSunClose(soapModel.getSunClose());
129         model.setMonOpen(soapModel.getMonOpen());
130         model.setMonClose(soapModel.getMonClose());
131         model.setTueOpen(soapModel.getTueOpen());
132         model.setTueClose(soapModel.getTueClose());
133         model.setWedOpen(soapModel.getWedOpen());
134         model.setWedClose(soapModel.getWedClose());
135         model.setThuOpen(soapModel.getThuOpen());
136         model.setThuClose(soapModel.getThuClose());
137         model.setFriOpen(soapModel.getFriOpen());
138         model.setFriClose(soapModel.getFriClose());
139         model.setSatOpen(soapModel.getSatOpen());
140         model.setSatClose(soapModel.getSatClose());
141 
142         return model;
143     }
144 
145     public static List<OrgLabor> toModels(OrgLaborSoap[] soapModels) {
146         List<OrgLabor> models = new ArrayList<OrgLabor>(soapModels.length);
147 
148         for (OrgLaborSoap soapModel : soapModels) {
149             models.add(toModel(soapModel));
150         }
151 
152         return models;
153     }
154 
155     public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
156                 "lock.expiration.time.com.liferay.portal.model.OrgLabor"));
157 
158     public OrgLaborModelImpl() {
159     }
160 
161     public long getPrimaryKey() {
162         return _orgLaborId;
163     }
164 
165     public void setPrimaryKey(long pk) {
166         setOrgLaborId(pk);
167     }
168 
169     public Serializable getPrimaryKeyObj() {
170         return new Long(_orgLaborId);
171     }
172 
173     public long getOrgLaborId() {
174         return _orgLaborId;
175     }
176 
177     public void setOrgLaborId(long orgLaborId) {
178         if (orgLaborId != _orgLaborId) {
179             _orgLaborId = orgLaborId;
180         }
181     }
182 
183     public long getOrganizationId() {
184         return _organizationId;
185     }
186 
187     public void setOrganizationId(long organizationId) {
188         if (organizationId != _organizationId) {
189             _organizationId = organizationId;
190         }
191     }
192 
193     public int getTypeId() {
194         return _typeId;
195     }
196 
197     public void setTypeId(int typeId) {
198         if (typeId != _typeId) {
199             _typeId = typeId;
200         }
201     }
202 
203     public int getSunOpen() {
204         return _sunOpen;
205     }
206 
207     public void setSunOpen(int sunOpen) {
208         if (sunOpen != _sunOpen) {
209             _sunOpen = sunOpen;
210         }
211     }
212 
213     public int getSunClose() {
214         return _sunClose;
215     }
216 
217     public void setSunClose(int sunClose) {
218         if (sunClose != _sunClose) {
219             _sunClose = sunClose;
220         }
221     }
222 
223     public int getMonOpen() {
224         return _monOpen;
225     }
226 
227     public void setMonOpen(int monOpen) {
228         if (monOpen != _monOpen) {
229             _monOpen = monOpen;
230         }
231     }
232 
233     public int getMonClose() {
234         return _monClose;
235     }
236 
237     public void setMonClose(int monClose) {
238         if (monClose != _monClose) {
239             _monClose = monClose;
240         }
241     }
242 
243     public int getTueOpen() {
244         return _tueOpen;
245     }
246 
247     public void setTueOpen(int tueOpen) {
248         if (tueOpen != _tueOpen) {
249             _tueOpen = tueOpen;
250         }
251     }
252 
253     public int getTueClose() {
254         return _tueClose;
255     }
256 
257     public void setTueClose(int tueClose) {
258         if (tueClose != _tueClose) {
259             _tueClose = tueClose;
260         }
261     }
262 
263     public int getWedOpen() {
264         return _wedOpen;
265     }
266 
267     public void setWedOpen(int wedOpen) {
268         if (wedOpen != _wedOpen) {
269             _wedOpen = wedOpen;
270         }
271     }
272 
273     public int getWedClose() {
274         return _wedClose;
275     }
276 
277     public void setWedClose(int wedClose) {
278         if (wedClose != _wedClose) {
279             _wedClose = wedClose;
280         }
281     }
282 
283     public int getThuOpen() {
284         return _thuOpen;
285     }
286 
287     public void setThuOpen(int thuOpen) {
288         if (thuOpen != _thuOpen) {
289             _thuOpen = thuOpen;
290         }
291     }
292 
293     public int getThuClose() {
294         return _thuClose;
295     }
296 
297     public void setThuClose(int thuClose) {
298         if (thuClose != _thuClose) {
299             _thuClose = thuClose;
300         }
301     }
302 
303     public int getFriOpen() {
304         return _friOpen;
305     }
306 
307     public void setFriOpen(int friOpen) {
308         if (friOpen != _friOpen) {
309             _friOpen = friOpen;
310         }
311     }
312 
313     public int getFriClose() {
314         return _friClose;
315     }
316 
317     public void setFriClose(int friClose) {
318         if (friClose != _friClose) {
319             _friClose = friClose;
320         }
321     }
322 
323     public int getSatOpen() {
324         return _satOpen;
325     }
326 
327     public void setSatOpen(int satOpen) {
328         if (satOpen != _satOpen) {
329             _satOpen = satOpen;
330         }
331     }
332 
333     public int getSatClose() {
334         return _satClose;
335     }
336 
337     public void setSatClose(int satClose) {
338         if (satClose != _satClose) {
339             _satClose = satClose;
340         }
341     }
342 
343     public OrgLabor toEscapedModel() {
344         if (isEscapedModel()) {
345             return (OrgLabor)this;
346         }
347         else {
348             OrgLabor model = new OrgLaborImpl();
349 
350             model.setEscapedModel(true);
351 
352             model.setOrgLaborId(getOrgLaborId());
353             model.setOrganizationId(getOrganizationId());
354             model.setTypeId(getTypeId());
355             model.setSunOpen(getSunOpen());
356             model.setSunClose(getSunClose());
357             model.setMonOpen(getMonOpen());
358             model.setMonClose(getMonClose());
359             model.setTueOpen(getTueOpen());
360             model.setTueClose(getTueClose());
361             model.setWedOpen(getWedOpen());
362             model.setWedClose(getWedClose());
363             model.setThuOpen(getThuOpen());
364             model.setThuClose(getThuClose());
365             model.setFriOpen(getFriOpen());
366             model.setFriClose(getFriClose());
367             model.setSatOpen(getSatOpen());
368             model.setSatClose(getSatClose());
369 
370             model = (OrgLabor)Proxy.newProxyInstance(OrgLabor.class.getClassLoader(),
371                     new Class[] { OrgLabor.class },
372                     new ReadOnlyBeanHandler(model));
373 
374             return model;
375         }
376     }
377 
378     public Object clone() {
379         OrgLaborImpl clone = new OrgLaborImpl();
380 
381         clone.setOrgLaborId(getOrgLaborId());
382         clone.setOrganizationId(getOrganizationId());
383         clone.setTypeId(getTypeId());
384         clone.setSunOpen(getSunOpen());
385         clone.setSunClose(getSunClose());
386         clone.setMonOpen(getMonOpen());
387         clone.setMonClose(getMonClose());
388         clone.setTueOpen(getTueOpen());
389         clone.setTueClose(getTueClose());
390         clone.setWedOpen(getWedOpen());
391         clone.setWedClose(getWedClose());
392         clone.setThuOpen(getThuOpen());
393         clone.setThuClose(getThuClose());
394         clone.setFriOpen(getFriOpen());
395         clone.setFriClose(getFriClose());
396         clone.setSatOpen(getSatOpen());
397         clone.setSatClose(getSatClose());
398 
399         return clone;
400     }
401 
402     public int compareTo(Object obj) {
403         if (obj == null) {
404             return -1;
405         }
406 
407         OrgLaborImpl orgLabor = (OrgLaborImpl)obj;
408 
409         int value = 0;
410 
411         if (getOrganizationId() < orgLabor.getOrganizationId()) {
412             value = -1;
413         }
414         else if (getOrganizationId() > orgLabor.getOrganizationId()) {
415             value = 1;
416         }
417         else {
418             value = 0;
419         }
420 
421         if (value != 0) {
422             return value;
423         }
424 
425         if (getTypeId() < orgLabor.getTypeId()) {
426             value = -1;
427         }
428         else if (getTypeId() > orgLabor.getTypeId()) {
429             value = 1;
430         }
431         else {
432             value = 0;
433         }
434 
435         if (value != 0) {
436             return value;
437         }
438 
439         return 0;
440     }
441 
442     public boolean equals(Object obj) {
443         if (obj == null) {
444             return false;
445         }
446 
447         OrgLaborImpl orgLabor = null;
448 
449         try {
450             orgLabor = (OrgLaborImpl)obj;
451         }
452         catch (ClassCastException cce) {
453             return false;
454         }
455 
456         long pk = orgLabor.getPrimaryKey();
457 
458         if (getPrimaryKey() == pk) {
459             return true;
460         }
461         else {
462             return false;
463         }
464     }
465 
466     public int hashCode() {
467         return (int)getPrimaryKey();
468     }
469 
470     private long _orgLaborId;
471     private long _organizationId;
472     private int _typeId;
473     private int _sunOpen;
474     private int _sunClose;
475     private int _monOpen;
476     private int _monClose;
477     private int _tueOpen;
478     private int _tueClose;
479     private int _wedOpen;
480     private int _wedClose;
481     private int _thuOpen;
482     private int _thuClose;
483     private int _friOpen;
484     private int _friClose;
485     private int _satOpen;
486     private int _satClose;
487 }