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