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