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.UserTrackerPath;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.util.Html;
029:
030: import java.io.Serializable;
031:
032: import java.lang.reflect.Proxy;
033:
034: import java.sql.Types;
035:
036: import java.util.Date;
037:
038: /**
039: * <a href="UserTrackerPathModelImpl.java.html"><b><i>View Source</i></b></a>
040: *
041: * <p>
042: * ServiceBuilder generated this class. Modifications in this class will be
043: * overwritten the next time is generated.
044: * </p>
045: *
046: * <p>
047: * This class is a model that represents the <code>UserTrackerPath</code> table
048: * in the database.
049: * </p>
050: *
051: * @author Brian Wing Shun Chan
052: *
053: * @see com.liferay.portal.service.model.UserTrackerPath
054: * @see com.liferay.portal.service.model.UserTrackerPathModel
055: * @see com.liferay.portal.service.model.impl.UserTrackerPathImpl
056: *
057: */
058: public class UserTrackerPathModelImpl extends BaseModelImpl {
059: public static final String TABLE_NAME = "UserTrackerPath";
060: public static final Object[][] TABLE_COLUMNS = {
061: { "userTrackerPathId", new Integer(Types.BIGINT) },
062:
063: { "userTrackerId", new Integer(Types.BIGINT) },
064:
065: { "path_", new Integer(Types.VARCHAR) },
066:
067: { "pathDate", new Integer(Types.TIMESTAMP) } };
068: public static final String TABLE_SQL_CREATE = "create table UserTrackerPath (userTrackerPathId LONG not null primary key,userTrackerId LONG,path_ STRING null,pathDate DATE null)";
069: public static final String TABLE_SQL_DROP = "drop table UserTrackerPath";
070: public static final boolean CACHE_ENABLED = GetterUtil
071: .getBoolean(
072: PropsUtil
073: .get("value.object.finder.cache.enabled.com.liferay.portal.model.UserTrackerPath"),
074: true);
075: public static final long LOCK_EXPIRATION_TIME = GetterUtil
076: .getLong(PropsUtil
077: .get("lock.expiration.time.com.liferay.portal.model.UserTrackerPath"));
078:
079: public UserTrackerPathModelImpl() {
080: }
081:
082: public long getPrimaryKey() {
083: return _userTrackerPathId;
084: }
085:
086: public void setPrimaryKey(long pk) {
087: setUserTrackerPathId(pk);
088: }
089:
090: public Serializable getPrimaryKeyObj() {
091: return new Long(_userTrackerPathId);
092: }
093:
094: public long getUserTrackerPathId() {
095: return _userTrackerPathId;
096: }
097:
098: public void setUserTrackerPathId(long userTrackerPathId) {
099: if (userTrackerPathId != _userTrackerPathId) {
100: _userTrackerPathId = userTrackerPathId;
101: }
102: }
103:
104: public long getUserTrackerId() {
105: return _userTrackerId;
106: }
107:
108: public void setUserTrackerId(long userTrackerId) {
109: if (userTrackerId != _userTrackerId) {
110: _userTrackerId = userTrackerId;
111: }
112: }
113:
114: public String getPath() {
115: return GetterUtil.getString(_path);
116: }
117:
118: public void setPath(String path) {
119: if (((path == null) && (_path != null))
120: || ((path != null) && (_path == null))
121: || ((path != null) && (_path != null) && !path
122: .equals(_path))) {
123: _path = path;
124: }
125: }
126:
127: public Date getPathDate() {
128: return _pathDate;
129: }
130:
131: public void setPathDate(Date pathDate) {
132: if (((pathDate == null) && (_pathDate != null))
133: || ((pathDate != null) && (_pathDate == null))
134: || ((pathDate != null) && (_pathDate != null) && !pathDate
135: .equals(_pathDate))) {
136: _pathDate = pathDate;
137: }
138: }
139:
140: public UserTrackerPath toEscapedModel() {
141: if (isEscapedModel()) {
142: return (UserTrackerPath) this ;
143: } else {
144: UserTrackerPath model = new UserTrackerPathImpl();
145:
146: model.setEscapedModel(true);
147:
148: model.setUserTrackerPathId(getUserTrackerPathId());
149: model.setUserTrackerId(getUserTrackerId());
150: model.setPath(Html.escape(getPath()));
151: model.setPathDate(getPathDate());
152:
153: model = (UserTrackerPath) Proxy.newProxyInstance(
154: UserTrackerPath.class.getClassLoader(),
155: new Class[] { UserTrackerPath.class },
156: new ReadOnlyBeanHandler(model));
157:
158: return model;
159: }
160: }
161:
162: public Object clone() {
163: UserTrackerPathImpl clone = new UserTrackerPathImpl();
164:
165: clone.setUserTrackerPathId(getUserTrackerPathId());
166: clone.setUserTrackerId(getUserTrackerId());
167: clone.setPath(getPath());
168: clone.setPathDate(getPathDate());
169:
170: return clone;
171: }
172:
173: public int compareTo(Object obj) {
174: if (obj == null) {
175: return -1;
176: }
177:
178: UserTrackerPathImpl userTrackerPath = (UserTrackerPathImpl) obj;
179:
180: long pk = userTrackerPath.getPrimaryKey();
181:
182: if (getPrimaryKey() < pk) {
183: return -1;
184: } else if (getPrimaryKey() > pk) {
185: return 1;
186: } else {
187: return 0;
188: }
189: }
190:
191: public boolean equals(Object obj) {
192: if (obj == null) {
193: return false;
194: }
195:
196: UserTrackerPathImpl userTrackerPath = null;
197:
198: try {
199: userTrackerPath = (UserTrackerPathImpl) obj;
200: } catch (ClassCastException cce) {
201: return false;
202: }
203:
204: long pk = userTrackerPath.getPrimaryKey();
205:
206: if (getPrimaryKey() == pk) {
207: return true;
208: } else {
209: return false;
210: }
211: }
212:
213: public int hashCode() {
214: return (int) getPrimaryKey();
215: }
216:
217: private long _userTrackerPathId;
218: private long _userTrackerId;
219: private String _path;
220: private Date _pathDate;
221: }
|