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.DateUtil;
025: import com.liferay.portal.kernel.util.GetterUtil;
026: import com.liferay.portal.model.ActivityTracker;
027: import com.liferay.portal.util.PropsUtil;
028:
029: import com.liferay.util.Html;
030:
031: import java.io.Serializable;
032:
033: import java.lang.reflect.Proxy;
034:
035: import java.sql.Types;
036:
037: import java.util.Date;
038:
039: /**
040: * <a href="ActivityTrackerModelImpl.java.html"><b><i>View Source</i></b></a>
041: *
042: * <p>
043: * ServiceBuilder generated this class. Modifications in this class will be
044: * overwritten the next time is generated.
045: * </p>
046: *
047: * <p>
048: * This class is a model that represents the <code>ActivityTracker</code> table
049: * in the database.
050: * </p>
051: *
052: * @author Brian Wing Shun Chan
053: *
054: * @see com.liferay.portal.service.model.ActivityTracker
055: * @see com.liferay.portal.service.model.ActivityTrackerModel
056: * @see com.liferay.portal.service.model.impl.ActivityTrackerImpl
057: *
058: */
059: public class ActivityTrackerModelImpl extends BaseModelImpl {
060: public static final String TABLE_NAME = "ActivityTracker";
061: public static final Object[][] TABLE_COLUMNS = {
062: { "activityTrackerId", new Integer(Types.BIGINT) },
063:
064: { "groupId", new Integer(Types.BIGINT) },
065:
066: { "companyId", new Integer(Types.BIGINT) },
067:
068: { "userId", new Integer(Types.BIGINT) },
069:
070: { "userName", new Integer(Types.VARCHAR) },
071:
072: { "createDate", new Integer(Types.TIMESTAMP) },
073:
074: { "classNameId", new Integer(Types.BIGINT) },
075:
076: { "classPK", new Integer(Types.BIGINT) },
077:
078: { "activity", new Integer(Types.VARCHAR) },
079:
080: { "extraData", new Integer(Types.CLOB) },
081:
082: { "receiverUserId", new Integer(Types.BIGINT) },
083:
084: { "receiverUserName", new Integer(Types.VARCHAR) } };
085: public static final String TABLE_SQL_CREATE = "create table ActivityTracker (activityTrackerId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,classNameId LONG,classPK LONG,activity VARCHAR(75) null,extraData TEXT null,receiverUserId LONG,receiverUserName VARCHAR(75) null)";
086: public static final String TABLE_SQL_DROP = "drop table ActivityTracker";
087: public static final boolean CACHE_ENABLED = GetterUtil
088: .getBoolean(
089: PropsUtil
090: .get("value.object.finder.cache.enabled.com.liferay.portal.model.ActivityTracker"),
091: true);
092: public static final long LOCK_EXPIRATION_TIME = GetterUtil
093: .getLong(PropsUtil
094: .get("lock.expiration.time.com.liferay.portal.model.ActivityTracker"));
095:
096: public ActivityTrackerModelImpl() {
097: }
098:
099: public long getPrimaryKey() {
100: return _activityTrackerId;
101: }
102:
103: public void setPrimaryKey(long pk) {
104: setActivityTrackerId(pk);
105: }
106:
107: public Serializable getPrimaryKeyObj() {
108: return new Long(_activityTrackerId);
109: }
110:
111: public long getActivityTrackerId() {
112: return _activityTrackerId;
113: }
114:
115: public void setActivityTrackerId(long activityTrackerId) {
116: if (activityTrackerId != _activityTrackerId) {
117: _activityTrackerId = activityTrackerId;
118: }
119: }
120:
121: public long getGroupId() {
122: return _groupId;
123: }
124:
125: public void setGroupId(long groupId) {
126: if (groupId != _groupId) {
127: _groupId = groupId;
128: }
129: }
130:
131: public long getCompanyId() {
132: return _companyId;
133: }
134:
135: public void setCompanyId(long companyId) {
136: if (companyId != _companyId) {
137: _companyId = companyId;
138: }
139: }
140:
141: public long getUserId() {
142: return _userId;
143: }
144:
145: public void setUserId(long userId) {
146: if (userId != _userId) {
147: _userId = userId;
148: }
149: }
150:
151: public String getUserName() {
152: return GetterUtil.getString(_userName);
153: }
154:
155: public void setUserName(String userName) {
156: if (((userName == null) && (_userName != null))
157: || ((userName != null) && (_userName == null))
158: || ((userName != null) && (_userName != null) && !userName
159: .equals(_userName))) {
160: _userName = userName;
161: }
162: }
163:
164: public Date getCreateDate() {
165: return _createDate;
166: }
167:
168: public void setCreateDate(Date createDate) {
169: if (((createDate == null) && (_createDate != null))
170: || ((createDate != null) && (_createDate == null))
171: || ((createDate != null) && (_createDate != null) && !createDate
172: .equals(_createDate))) {
173: _createDate = createDate;
174: }
175: }
176:
177: public long getClassNameId() {
178: return _classNameId;
179: }
180:
181: public void setClassNameId(long classNameId) {
182: if (classNameId != _classNameId) {
183: _classNameId = classNameId;
184: }
185: }
186:
187: public long getClassPK() {
188: return _classPK;
189: }
190:
191: public void setClassPK(long classPK) {
192: if (classPK != _classPK) {
193: _classPK = classPK;
194: }
195: }
196:
197: public String getActivity() {
198: return GetterUtil.getString(_activity);
199: }
200:
201: public void setActivity(String activity) {
202: if (((activity == null) && (_activity != null))
203: || ((activity != null) && (_activity == null))
204: || ((activity != null) && (_activity != null) && !activity
205: .equals(_activity))) {
206: _activity = activity;
207: }
208: }
209:
210: public String getExtraData() {
211: return GetterUtil.getString(_extraData);
212: }
213:
214: public void setExtraData(String extraData) {
215: if (((extraData == null) && (_extraData != null))
216: || ((extraData != null) && (_extraData == null))
217: || ((extraData != null) && (_extraData != null) && !extraData
218: .equals(_extraData))) {
219: _extraData = extraData;
220: }
221: }
222:
223: public long getReceiverUserId() {
224: return _receiverUserId;
225: }
226:
227: public void setReceiverUserId(long receiverUserId) {
228: if (receiverUserId != _receiverUserId) {
229: _receiverUserId = receiverUserId;
230: }
231: }
232:
233: public String getReceiverUserName() {
234: return GetterUtil.getString(_receiverUserName);
235: }
236:
237: public void setReceiverUserName(String receiverUserName) {
238: if (((receiverUserName == null) && (_receiverUserName != null))
239: || ((receiverUserName != null) && (_receiverUserName == null))
240: || ((receiverUserName != null)
241: && (_receiverUserName != null) && !receiverUserName
242: .equals(_receiverUserName))) {
243: _receiverUserName = receiverUserName;
244: }
245: }
246:
247: public ActivityTracker toEscapedModel() {
248: if (isEscapedModel()) {
249: return (ActivityTracker) this ;
250: } else {
251: ActivityTracker model = new ActivityTrackerImpl();
252:
253: model.setEscapedModel(true);
254:
255: model.setActivityTrackerId(getActivityTrackerId());
256: model.setGroupId(getGroupId());
257: model.setCompanyId(getCompanyId());
258: model.setUserId(getUserId());
259: model.setUserName(Html.escape(getUserName()));
260: model.setCreateDate(getCreateDate());
261: model.setClassNameId(getClassNameId());
262: model.setClassPK(getClassPK());
263: model.setActivity(Html.escape(getActivity()));
264: model.setExtraData(Html.escape(getExtraData()));
265: model.setReceiverUserId(getReceiverUserId());
266: model.setReceiverUserName(Html
267: .escape(getReceiverUserName()));
268:
269: model = (ActivityTracker) Proxy.newProxyInstance(
270: ActivityTracker.class.getClassLoader(),
271: new Class[] { ActivityTracker.class },
272: new ReadOnlyBeanHandler(model));
273:
274: return model;
275: }
276: }
277:
278: public Object clone() {
279: ActivityTrackerImpl clone = new ActivityTrackerImpl();
280:
281: clone.setActivityTrackerId(getActivityTrackerId());
282: clone.setGroupId(getGroupId());
283: clone.setCompanyId(getCompanyId());
284: clone.setUserId(getUserId());
285: clone.setUserName(getUserName());
286: clone.setCreateDate(getCreateDate());
287: clone.setClassNameId(getClassNameId());
288: clone.setClassPK(getClassPK());
289: clone.setActivity(getActivity());
290: clone.setExtraData(getExtraData());
291: clone.setReceiverUserId(getReceiverUserId());
292: clone.setReceiverUserName(getReceiverUserName());
293:
294: return clone;
295: }
296:
297: public int compareTo(Object obj) {
298: if (obj == null) {
299: return -1;
300: }
301:
302: ActivityTrackerImpl activityTracker = (ActivityTrackerImpl) obj;
303:
304: int value = 0;
305:
306: value = DateUtil.compareTo(getCreateDate(), activityTracker
307: .getCreateDate());
308:
309: value = value * -1;
310:
311: if (value != 0) {
312: return value;
313: }
314:
315: return 0;
316: }
317:
318: public boolean equals(Object obj) {
319: if (obj == null) {
320: return false;
321: }
322:
323: ActivityTrackerImpl activityTracker = null;
324:
325: try {
326: activityTracker = (ActivityTrackerImpl) obj;
327: } catch (ClassCastException cce) {
328: return false;
329: }
330:
331: long pk = activityTracker.getPrimaryKey();
332:
333: if (getPrimaryKey() == pk) {
334: return true;
335: } else {
336: return false;
337: }
338: }
339:
340: public int hashCode() {
341: return (int) getPrimaryKey();
342: }
343:
344: private long _activityTrackerId;
345: private long _groupId;
346: private long _companyId;
347: private long _userId;
348: private String _userName;
349: private Date _createDate;
350: private long _classNameId;
351: private long _classPK;
352: private String _activity;
353: private String _extraData;
354: private long _receiverUserId;
355: private String _receiverUserName;
356: }
|