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