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