001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.model.impl;
022:
023: import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
024: import com.liferay.portal.kernel.util.GetterUtil;
025: import com.liferay.portal.model.OrgLabor;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import java.io.Serializable;
029:
030: import java.lang.reflect.Proxy;
031:
032: import java.sql.Types;
033:
034: /**
035: * <a href="OrgLaborModelImpl.java.html"><b><i>View Source</i></b></a>
036: *
037: * <p>
038: * ServiceBuilder generated this class. Modifications in this class will be
039: * overwritten the next time is generated.
040: * </p>
041: *
042: * <p>
043: * This class is a model that represents the <code>OrgLabor</code> table
044: * in the database.
045: * </p>
046: *
047: * @author Brian Wing Shun Chan
048: *
049: * @see com.liferay.portal.service.model.OrgLabor
050: * @see com.liferay.portal.service.model.OrgLaborModel
051: * @see com.liferay.portal.service.model.impl.OrgLaborImpl
052: *
053: */
054: public class OrgLaborModelImpl extends BaseModelImpl {
055: public static final String TABLE_NAME = "OrgLabor";
056: public static final Object[][] TABLE_COLUMNS = {
057: { "orgLaborId", new Integer(Types.BIGINT) },
058:
059: { "organizationId", new Integer(Types.BIGINT) },
060:
061: { "typeId", new Integer(Types.INTEGER) },
062:
063: { "sunOpen", new Integer(Types.INTEGER) },
064:
065: { "sunClose", new Integer(Types.INTEGER) },
066:
067: { "monOpen", new Integer(Types.INTEGER) },
068:
069: { "monClose", new Integer(Types.INTEGER) },
070:
071: { "tueOpen", new Integer(Types.INTEGER) },
072:
073: { "tueClose", new Integer(Types.INTEGER) },
074:
075: { "wedOpen", new Integer(Types.INTEGER) },
076:
077: { "wedClose", new Integer(Types.INTEGER) },
078:
079: { "thuOpen", new Integer(Types.INTEGER) },
080:
081: { "thuClose", new Integer(Types.INTEGER) },
082:
083: { "friOpen", new Integer(Types.INTEGER) },
084:
085: { "friClose", new Integer(Types.INTEGER) },
086:
087: { "satOpen", new Integer(Types.INTEGER) },
088:
089: { "satClose", new Integer(Types.INTEGER) } };
090: 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)";
091: public static final String TABLE_SQL_DROP = "drop table OrgLabor";
092: public static final boolean CACHE_ENABLED = GetterUtil
093: .getBoolean(
094: PropsUtil
095: .get("value.object.finder.cache.enabled.com.liferay.portal.model.OrgLabor"),
096: true);
097: public static final long LOCK_EXPIRATION_TIME = GetterUtil
098: .getLong(PropsUtil
099: .get("lock.expiration.time.com.liferay.portal.model.OrgLabor"));
100:
101: public OrgLaborModelImpl() {
102: }
103:
104: public long getPrimaryKey() {
105: return _orgLaborId;
106: }
107:
108: public void setPrimaryKey(long pk) {
109: setOrgLaborId(pk);
110: }
111:
112: public Serializable getPrimaryKeyObj() {
113: return new Long(_orgLaborId);
114: }
115:
116: public long getOrgLaborId() {
117: return _orgLaborId;
118: }
119:
120: public void setOrgLaborId(long orgLaborId) {
121: if (orgLaborId != _orgLaborId) {
122: _orgLaborId = orgLaborId;
123: }
124: }
125:
126: public long getOrganizationId() {
127: return _organizationId;
128: }
129:
130: public void setOrganizationId(long organizationId) {
131: if (organizationId != _organizationId) {
132: _organizationId = organizationId;
133: }
134: }
135:
136: public int getTypeId() {
137: return _typeId;
138: }
139:
140: public void setTypeId(int typeId) {
141: if (typeId != _typeId) {
142: _typeId = typeId;
143: }
144: }
145:
146: public int getSunOpen() {
147: return _sunOpen;
148: }
149:
150: public void setSunOpen(int sunOpen) {
151: if (sunOpen != _sunOpen) {
152: _sunOpen = sunOpen;
153: }
154: }
155:
156: public int getSunClose() {
157: return _sunClose;
158: }
159:
160: public void setSunClose(int sunClose) {
161: if (sunClose != _sunClose) {
162: _sunClose = sunClose;
163: }
164: }
165:
166: public int getMonOpen() {
167: return _monOpen;
168: }
169:
170: public void setMonOpen(int monOpen) {
171: if (monOpen != _monOpen) {
172: _monOpen = monOpen;
173: }
174: }
175:
176: public int getMonClose() {
177: return _monClose;
178: }
179:
180: public void setMonClose(int monClose) {
181: if (monClose != _monClose) {
182: _monClose = monClose;
183: }
184: }
185:
186: public int getTueOpen() {
187: return _tueOpen;
188: }
189:
190: public void setTueOpen(int tueOpen) {
191: if (tueOpen != _tueOpen) {
192: _tueOpen = tueOpen;
193: }
194: }
195:
196: public int getTueClose() {
197: return _tueClose;
198: }
199:
200: public void setTueClose(int tueClose) {
201: if (tueClose != _tueClose) {
202: _tueClose = tueClose;
203: }
204: }
205:
206: public int getWedOpen() {
207: return _wedOpen;
208: }
209:
210: public void setWedOpen(int wedOpen) {
211: if (wedOpen != _wedOpen) {
212: _wedOpen = wedOpen;
213: }
214: }
215:
216: public int getWedClose() {
217: return _wedClose;
218: }
219:
220: public void setWedClose(int wedClose) {
221: if (wedClose != _wedClose) {
222: _wedClose = wedClose;
223: }
224: }
225:
226: public int getThuOpen() {
227: return _thuOpen;
228: }
229:
230: public void setThuOpen(int thuOpen) {
231: if (thuOpen != _thuOpen) {
232: _thuOpen = thuOpen;
233: }
234: }
235:
236: public int getThuClose() {
237: return _thuClose;
238: }
239:
240: public void setThuClose(int thuClose) {
241: if (thuClose != _thuClose) {
242: _thuClose = thuClose;
243: }
244: }
245:
246: public int getFriOpen() {
247: return _friOpen;
248: }
249:
250: public void setFriOpen(int friOpen) {
251: if (friOpen != _friOpen) {
252: _friOpen = friOpen;
253: }
254: }
255:
256: public int getFriClose() {
257: return _friClose;
258: }
259:
260: public void setFriClose(int friClose) {
261: if (friClose != _friClose) {
262: _friClose = friClose;
263: }
264: }
265:
266: public int getSatOpen() {
267: return _satOpen;
268: }
269:
270: public void setSatOpen(int satOpen) {
271: if (satOpen != _satOpen) {
272: _satOpen = satOpen;
273: }
274: }
275:
276: public int getSatClose() {
277: return _satClose;
278: }
279:
280: public void setSatClose(int satClose) {
281: if (satClose != _satClose) {
282: _satClose = satClose;
283: }
284: }
285:
286: public OrgLabor toEscapedModel() {
287: if (isEscapedModel()) {
288: return (OrgLabor) this ;
289: } else {
290: OrgLabor model = new OrgLaborImpl();
291:
292: model.setEscapedModel(true);
293:
294: model.setOrgLaborId(getOrgLaborId());
295: model.setOrganizationId(getOrganizationId());
296: model.setTypeId(getTypeId());
297: model.setSunOpen(getSunOpen());
298: model.setSunClose(getSunClose());
299: model.setMonOpen(getMonOpen());
300: model.setMonClose(getMonClose());
301: model.setTueOpen(getTueOpen());
302: model.setTueClose(getTueClose());
303: model.setWedOpen(getWedOpen());
304: model.setWedClose(getWedClose());
305: model.setThuOpen(getThuOpen());
306: model.setThuClose(getThuClose());
307: model.setFriOpen(getFriOpen());
308: model.setFriClose(getFriClose());
309: model.setSatOpen(getSatOpen());
310: model.setSatClose(getSatClose());
311:
312: model = (OrgLabor) Proxy.newProxyInstance(OrgLabor.class
313: .getClassLoader(), new Class[] { OrgLabor.class },
314: new ReadOnlyBeanHandler(model));
315:
316: return model;
317: }
318: }
319:
320: public Object clone() {
321: OrgLaborImpl clone = new OrgLaborImpl();
322:
323: clone.setOrgLaborId(getOrgLaborId());
324: clone.setOrganizationId(getOrganizationId());
325: clone.setTypeId(getTypeId());
326: clone.setSunOpen(getSunOpen());
327: clone.setSunClose(getSunClose());
328: clone.setMonOpen(getMonOpen());
329: clone.setMonClose(getMonClose());
330: clone.setTueOpen(getTueOpen());
331: clone.setTueClose(getTueClose());
332: clone.setWedOpen(getWedOpen());
333: clone.setWedClose(getWedClose());
334: clone.setThuOpen(getThuOpen());
335: clone.setThuClose(getThuClose());
336: clone.setFriOpen(getFriOpen());
337: clone.setFriClose(getFriClose());
338: clone.setSatOpen(getSatOpen());
339: clone.setSatClose(getSatClose());
340:
341: return clone;
342: }
343:
344: public int compareTo(Object obj) {
345: if (obj == null) {
346: return -1;
347: }
348:
349: OrgLaborImpl orgLabor = (OrgLaborImpl) obj;
350:
351: int value = 0;
352:
353: if (getOrganizationId() < orgLabor.getOrganizationId()) {
354: value = -1;
355: } else if (getOrganizationId() > orgLabor.getOrganizationId()) {
356: value = 1;
357: } else {
358: value = 0;
359: }
360:
361: if (value != 0) {
362: return value;
363: }
364:
365: if (getTypeId() < orgLabor.getTypeId()) {
366: value = -1;
367: } else if (getTypeId() > orgLabor.getTypeId()) {
368: value = 1;
369: } else {
370: value = 0;
371: }
372:
373: if (value != 0) {
374: return value;
375: }
376:
377: return 0;
378: }
379:
380: public boolean equals(Object obj) {
381: if (obj == null) {
382: return false;
383: }
384:
385: OrgLaborImpl orgLabor = null;
386:
387: try {
388: orgLabor = (OrgLaborImpl) obj;
389: } catch (ClassCastException cce) {
390: return false;
391: }
392:
393: long pk = orgLabor.getPrimaryKey();
394:
395: if (getPrimaryKey() == pk) {
396: return true;
397: } else {
398: return false;
399: }
400: }
401:
402: public int hashCode() {
403: return (int) getPrimaryKey();
404: }
405:
406: private long _orgLaborId;
407: private long _organizationId;
408: private int _typeId;
409: private int _sunOpen;
410: private int _sunClose;
411: private int _monOpen;
412: private int _monClose;
413: private int _tueOpen;
414: private int _tueClose;
415: private int _wedOpen;
416: private int _wedClose;
417: private int _thuOpen;
418: private int _thuClose;
419: private int _friOpen;
420: private int _friClose;
421: private int _satOpen;
422: private int _satClose;
423: }
|