1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.model.impl;
21  
22  import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
23  import com.liferay.portal.kernel.util.GetterUtil;
24  import com.liferay.portal.model.OrgLabor;
25  import com.liferay.portal.model.OrgLaborSoap;
26  
27  import java.io.Serializable;
28  
29  import java.lang.reflect.Proxy;
30  
31  import java.sql.Types;
32  
33  import java.util.ArrayList;
34  import java.util.List;
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.model.OrgLabor
52   * @see com.liferay.portal.model.OrgLaborModel
53   * @see com.liferay.portal.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 String DATA_SOURCE = "liferayDataSource";
112     public static final String SESSION_FACTORY = "liferaySessionFactory";
113     public static final String TX_MANAGER = "liferayTransactionManager";
114     public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
115                 "value.object.finder.cache.enabled.com.liferay.portal.model.OrgLabor"),
116             true);
117 
118     public static OrgLabor toModel(OrgLaborSoap soapModel) {
119         OrgLabor model = new OrgLaborImpl();
120 
121         model.setOrgLaborId(soapModel.getOrgLaborId());
122         model.setOrganizationId(soapModel.getOrganizationId());
123         model.setTypeId(soapModel.getTypeId());
124         model.setSunOpen(soapModel.getSunOpen());
125         model.setSunClose(soapModel.getSunClose());
126         model.setMonOpen(soapModel.getMonOpen());
127         model.setMonClose(soapModel.getMonClose());
128         model.setTueOpen(soapModel.getTueOpen());
129         model.setTueClose(soapModel.getTueClose());
130         model.setWedOpen(soapModel.getWedOpen());
131         model.setWedClose(soapModel.getWedClose());
132         model.setThuOpen(soapModel.getThuOpen());
133         model.setThuClose(soapModel.getThuClose());
134         model.setFriOpen(soapModel.getFriOpen());
135         model.setFriClose(soapModel.getFriClose());
136         model.setSatOpen(soapModel.getSatOpen());
137         model.setSatClose(soapModel.getSatClose());
138 
139         return model;
140     }
141 
142     public static List<OrgLabor> toModels(OrgLaborSoap[] soapModels) {
143         List<OrgLabor> models = new ArrayList<OrgLabor>(soapModels.length);
144 
145         for (OrgLaborSoap soapModel : soapModels) {
146             models.add(toModel(soapModel));
147         }
148 
149         return models;
150     }
151 
152     public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
153                 "lock.expiration.time.com.liferay.portal.model.OrgLabor"));
154 
155     public OrgLaborModelImpl() {
156     }
157 
158     public long getPrimaryKey() {
159         return _orgLaborId;
160     }
161 
162     public void setPrimaryKey(long pk) {
163         setOrgLaborId(pk);
164     }
165 
166     public Serializable getPrimaryKeyObj() {
167         return new Long(_orgLaborId);
168     }
169 
170     public long getOrgLaborId() {
171         return _orgLaborId;
172     }
173 
174     public void setOrgLaborId(long orgLaborId) {
175         if (orgLaborId != _orgLaborId) {
176             _orgLaborId = orgLaborId;
177         }
178     }
179 
180     public long getOrganizationId() {
181         return _organizationId;
182     }
183 
184     public void setOrganizationId(long organizationId) {
185         if (organizationId != _organizationId) {
186             _organizationId = organizationId;
187         }
188     }
189 
190     public int getTypeId() {
191         return _typeId;
192     }
193 
194     public void setTypeId(int typeId) {
195         if (typeId != _typeId) {
196             _typeId = typeId;
197         }
198     }
199 
200     public int getSunOpen() {
201         return _sunOpen;
202     }
203 
204     public void setSunOpen(int sunOpen) {
205         if (sunOpen != _sunOpen) {
206             _sunOpen = sunOpen;
207         }
208     }
209 
210     public int getSunClose() {
211         return _sunClose;
212     }
213 
214     public void setSunClose(int sunClose) {
215         if (sunClose != _sunClose) {
216             _sunClose = sunClose;
217         }
218     }
219 
220     public int getMonOpen() {
221         return _monOpen;
222     }
223 
224     public void setMonOpen(int monOpen) {
225         if (monOpen != _monOpen) {
226             _monOpen = monOpen;
227         }
228     }
229 
230     public int getMonClose() {
231         return _monClose;
232     }
233 
234     public void setMonClose(int monClose) {
235         if (monClose != _monClose) {
236             _monClose = monClose;
237         }
238     }
239 
240     public int getTueOpen() {
241         return _tueOpen;
242     }
243 
244     public void setTueOpen(int tueOpen) {
245         if (tueOpen != _tueOpen) {
246             _tueOpen = tueOpen;
247         }
248     }
249 
250     public int getTueClose() {
251         return _tueClose;
252     }
253 
254     public void setTueClose(int tueClose) {
255         if (tueClose != _tueClose) {
256             _tueClose = tueClose;
257         }
258     }
259 
260     public int getWedOpen() {
261         return _wedOpen;
262     }
263 
264     public void setWedOpen(int wedOpen) {
265         if (wedOpen != _wedOpen) {
266             _wedOpen = wedOpen;
267         }
268     }
269 
270     public int getWedClose() {
271         return _wedClose;
272     }
273 
274     public void setWedClose(int wedClose) {
275         if (wedClose != _wedClose) {
276             _wedClose = wedClose;
277         }
278     }
279 
280     public int getThuOpen() {
281         return _thuOpen;
282     }
283 
284     public void setThuOpen(int thuOpen) {
285         if (thuOpen != _thuOpen) {
286             _thuOpen = thuOpen;
287         }
288     }
289 
290     public int getThuClose() {
291         return _thuClose;
292     }
293 
294     public void setThuClose(int thuClose) {
295         if (thuClose != _thuClose) {
296             _thuClose = thuClose;
297         }
298     }
299 
300     public int getFriOpen() {
301         return _friOpen;
302     }
303 
304     public void setFriOpen(int friOpen) {
305         if (friOpen != _friOpen) {
306             _friOpen = friOpen;
307         }
308     }
309 
310     public int getFriClose() {
311         return _friClose;
312     }
313 
314     public void setFriClose(int friClose) {
315         if (friClose != _friClose) {
316             _friClose = friClose;
317         }
318     }
319 
320     public int getSatOpen() {
321         return _satOpen;
322     }
323 
324     public void setSatOpen(int satOpen) {
325         if (satOpen != _satOpen) {
326             _satOpen = satOpen;
327         }
328     }
329 
330     public int getSatClose() {
331         return _satClose;
332     }
333 
334     public void setSatClose(int satClose) {
335         if (satClose != _satClose) {
336             _satClose = satClose;
337         }
338     }
339 
340     public OrgLabor toEscapedModel() {
341         if (isEscapedModel()) {
342             return (OrgLabor)this;
343         }
344         else {
345             OrgLabor model = new OrgLaborImpl();
346 
347             model.setNew(isNew());
348             model.setEscapedModel(true);
349 
350             model.setOrgLaborId(getOrgLaborId());
351             model.setOrganizationId(getOrganizationId());
352             model.setTypeId(getTypeId());
353             model.setSunOpen(getSunOpen());
354             model.setSunClose(getSunClose());
355             model.setMonOpen(getMonOpen());
356             model.setMonClose(getMonClose());
357             model.setTueOpen(getTueOpen());
358             model.setTueClose(getTueClose());
359             model.setWedOpen(getWedOpen());
360             model.setWedClose(getWedClose());
361             model.setThuOpen(getThuOpen());
362             model.setThuClose(getThuClose());
363             model.setFriOpen(getFriOpen());
364             model.setFriClose(getFriClose());
365             model.setSatOpen(getSatOpen());
366             model.setSatClose(getSatClose());
367 
368             model = (OrgLabor)Proxy.newProxyInstance(OrgLabor.class.getClassLoader(),
369                     new Class[] { OrgLabor.class },
370                     new ReadOnlyBeanHandler(model));
371 
372             return model;
373         }
374     }
375 
376     public Object clone() {
377         OrgLaborImpl clone = new OrgLaborImpl();
378 
379         clone.setOrgLaborId(getOrgLaborId());
380         clone.setOrganizationId(getOrganizationId());
381         clone.setTypeId(getTypeId());
382         clone.setSunOpen(getSunOpen());
383         clone.setSunClose(getSunClose());
384         clone.setMonOpen(getMonOpen());
385         clone.setMonClose(getMonClose());
386         clone.setTueOpen(getTueOpen());
387         clone.setTueClose(getTueClose());
388         clone.setWedOpen(getWedOpen());
389         clone.setWedClose(getWedClose());
390         clone.setThuOpen(getThuOpen());
391         clone.setThuClose(getThuClose());
392         clone.setFriOpen(getFriOpen());
393         clone.setFriClose(getFriClose());
394         clone.setSatOpen(getSatOpen());
395         clone.setSatClose(getSatClose());
396 
397         return clone;
398     }
399 
400     public int compareTo(Object obj) {
401         if (obj == null) {
402             return -1;
403         }
404 
405         OrgLaborImpl orgLabor = (OrgLaborImpl)obj;
406 
407         int value = 0;
408 
409         if (getOrganizationId() < orgLabor.getOrganizationId()) {
410             value = -1;
411         }
412         else if (getOrganizationId() > orgLabor.getOrganizationId()) {
413             value = 1;
414         }
415         else {
416             value = 0;
417         }
418 
419         if (value != 0) {
420             return value;
421         }
422 
423         if (getTypeId() < orgLabor.getTypeId()) {
424             value = -1;
425         }
426         else if (getTypeId() > orgLabor.getTypeId()) {
427             value = 1;
428         }
429         else {
430             value = 0;
431         }
432 
433         if (value != 0) {
434             return value;
435         }
436 
437         return 0;
438     }
439 
440     public boolean equals(Object obj) {
441         if (obj == null) {
442             return false;
443         }
444 
445         OrgLaborImpl orgLabor = null;
446 
447         try {
448             orgLabor = (OrgLaborImpl)obj;
449         }
450         catch (ClassCastException cce) {
451             return false;
452         }
453 
454         long pk = orgLabor.getPrimaryKey();
455 
456         if (getPrimaryKey() == pk) {
457             return true;
458         }
459         else {
460             return false;
461         }
462     }
463 
464     public int hashCode() {
465         return (int)getPrimaryKey();
466     }
467 
468     private long _orgLaborId;
469     private long _organizationId;
470     private int _typeId;
471     private int _sunOpen;
472     private int _sunClose;
473     private int _monOpen;
474     private int _monClose;
475     private int _tueOpen;
476     private int _tueClose;
477     private int _wedOpen;
478     private int _wedClose;
479     private int _thuOpen;
480     private int _thuClose;
481     private int _friOpen;
482     private int _friClose;
483     private int _satOpen;
484     private int _satClose;
485 }