1
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.kernel.util.HtmlUtil;
28 import com.liferay.portal.model.UserTrackerPath;
29 import com.liferay.portal.model.UserTrackerPathSoap;
30
31 import java.io.Serializable;
32
33 import java.lang.reflect.Proxy;
34
35 import java.sql.Types;
36
37 import java.util.ArrayList;
38 import java.util.Date;
39 import java.util.List;
40
41
61 public class UserTrackerPathModelImpl extends BaseModelImpl {
62 public static final String TABLE_NAME = "UserTrackerPath";
63 public static final Object[][] TABLE_COLUMNS = {
64 { "userTrackerPathId", new Integer(Types.BIGINT) },
65
66
67 { "userTrackerId", new Integer(Types.BIGINT) },
68
69
70 { "path_", new Integer(Types.VARCHAR) },
71
72
73 { "pathDate", new Integer(Types.TIMESTAMP) }
74 };
75 public static final String TABLE_SQL_CREATE = "create table UserTrackerPath (userTrackerPathId LONG not null primary key,userTrackerId LONG,path_ STRING null,pathDate DATE null)";
76 public static final String TABLE_SQL_DROP = "drop table UserTrackerPath";
77 public static final String DATA_SOURCE = "liferayDataSource";
78 public static final String SESSION_FACTORY = "liferaySessionFactory";
79 public static final String TX_MANAGER = "liferayTransactionManager";
80 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
81 "value.object.finder.cache.enabled.com.liferay.portal.model.UserTrackerPath"),
82 true);
83
84 public static UserTrackerPath toModel(UserTrackerPathSoap soapModel) {
85 UserTrackerPath model = new UserTrackerPathImpl();
86
87 model.setUserTrackerPathId(soapModel.getUserTrackerPathId());
88 model.setUserTrackerId(soapModel.getUserTrackerId());
89 model.setPath(soapModel.getPath());
90 model.setPathDate(soapModel.getPathDate());
91
92 return model;
93 }
94
95 public static List<UserTrackerPath> toModels(
96 UserTrackerPathSoap[] soapModels) {
97 List<UserTrackerPath> models = new ArrayList<UserTrackerPath>(soapModels.length);
98
99 for (UserTrackerPathSoap soapModel : soapModels) {
100 models.add(toModel(soapModel));
101 }
102
103 return models;
104 }
105
106 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
107 "lock.expiration.time.com.liferay.portal.model.UserTrackerPath"));
108
109 public UserTrackerPathModelImpl() {
110 }
111
112 public long getPrimaryKey() {
113 return _userTrackerPathId;
114 }
115
116 public void setPrimaryKey(long pk) {
117 setUserTrackerPathId(pk);
118 }
119
120 public Serializable getPrimaryKeyObj() {
121 return new Long(_userTrackerPathId);
122 }
123
124 public long getUserTrackerPathId() {
125 return _userTrackerPathId;
126 }
127
128 public void setUserTrackerPathId(long userTrackerPathId) {
129 if (userTrackerPathId != _userTrackerPathId) {
130 _userTrackerPathId = userTrackerPathId;
131 }
132 }
133
134 public long getUserTrackerId() {
135 return _userTrackerId;
136 }
137
138 public void setUserTrackerId(long userTrackerId) {
139 if (userTrackerId != _userTrackerId) {
140 _userTrackerId = userTrackerId;
141 }
142 }
143
144 public String getPath() {
145 return GetterUtil.getString(_path);
146 }
147
148 public void setPath(String path) {
149 if (((path == null) && (_path != null)) ||
150 ((path != null) && (_path == null)) ||
151 ((path != null) && (_path != null) && !path.equals(_path))) {
152 _path = path;
153 }
154 }
155
156 public Date getPathDate() {
157 return _pathDate;
158 }
159
160 public void setPathDate(Date pathDate) {
161 if (((pathDate == null) && (_pathDate != null)) ||
162 ((pathDate != null) && (_pathDate == null)) ||
163 ((pathDate != null) && (_pathDate != null) &&
164 !pathDate.equals(_pathDate))) {
165 _pathDate = pathDate;
166 }
167 }
168
169 public UserTrackerPath toEscapedModel() {
170 if (isEscapedModel()) {
171 return (UserTrackerPath)this;
172 }
173 else {
174 UserTrackerPath model = new UserTrackerPathImpl();
175
176 model.setEscapedModel(true);
177
178 model.setUserTrackerPathId(getUserTrackerPathId());
179 model.setUserTrackerId(getUserTrackerId());
180 model.setPath(HtmlUtil.escape(getPath()));
181 model.setPathDate(getPathDate());
182
183 model = (UserTrackerPath)Proxy.newProxyInstance(UserTrackerPath.class.getClassLoader(),
184 new Class[] { UserTrackerPath.class },
185 new ReadOnlyBeanHandler(model));
186
187 return model;
188 }
189 }
190
191 public Object clone() {
192 UserTrackerPathImpl clone = new UserTrackerPathImpl();
193
194 clone.setUserTrackerPathId(getUserTrackerPathId());
195 clone.setUserTrackerId(getUserTrackerId());
196 clone.setPath(getPath());
197 clone.setPathDate(getPathDate());
198
199 return clone;
200 }
201
202 public int compareTo(Object obj) {
203 if (obj == null) {
204 return -1;
205 }
206
207 UserTrackerPathImpl userTrackerPath = (UserTrackerPathImpl)obj;
208
209 long pk = userTrackerPath.getPrimaryKey();
210
211 if (getPrimaryKey() < pk) {
212 return -1;
213 }
214 else if (getPrimaryKey() > pk) {
215 return 1;
216 }
217 else {
218 return 0;
219 }
220 }
221
222 public boolean equals(Object obj) {
223 if (obj == null) {
224 return false;
225 }
226
227 UserTrackerPathImpl userTrackerPath = null;
228
229 try {
230 userTrackerPath = (UserTrackerPathImpl)obj;
231 }
232 catch (ClassCastException cce) {
233 return false;
234 }
235
236 long pk = userTrackerPath.getPrimaryKey();
237
238 if (getPrimaryKey() == pk) {
239 return true;
240 }
241 else {
242 return false;
243 }
244 }
245
246 public int hashCode() {
247 return (int)getPrimaryKey();
248 }
249
250 private long _userTrackerPathId;
251 private long _userTrackerId;
252 private String _path;
253 private Date _pathDate;
254 }