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.setNew(isNew());
177 model.setEscapedModel(true);
178
179 model.setUserTrackerPathId(getUserTrackerPathId());
180 model.setUserTrackerId(getUserTrackerId());
181 model.setPath(HtmlUtil.escape(getPath()));
182 model.setPathDate(getPathDate());
183
184 model = (UserTrackerPath)Proxy.newProxyInstance(UserTrackerPath.class.getClassLoader(),
185 new Class[] { UserTrackerPath.class },
186 new ReadOnlyBeanHandler(model));
187
188 return model;
189 }
190 }
191
192 public Object clone() {
193 UserTrackerPathImpl clone = new UserTrackerPathImpl();
194
195 clone.setUserTrackerPathId(getUserTrackerPathId());
196 clone.setUserTrackerId(getUserTrackerId());
197 clone.setPath(getPath());
198 clone.setPathDate(getPathDate());
199
200 return clone;
201 }
202
203 public int compareTo(Object obj) {
204 if (obj == null) {
205 return -1;
206 }
207
208 UserTrackerPathImpl userTrackerPath = (UserTrackerPathImpl)obj;
209
210 long pk = userTrackerPath.getPrimaryKey();
211
212 if (getPrimaryKey() < pk) {
213 return -1;
214 }
215 else if (getPrimaryKey() > pk) {
216 return 1;
217 }
218 else {
219 return 0;
220 }
221 }
222
223 public boolean equals(Object obj) {
224 if (obj == null) {
225 return false;
226 }
227
228 UserTrackerPathImpl userTrackerPath = null;
229
230 try {
231 userTrackerPath = (UserTrackerPathImpl)obj;
232 }
233 catch (ClassCastException cce) {
234 return false;
235 }
236
237 long pk = userTrackerPath.getPrimaryKey();
238
239 if (getPrimaryKey() == pk) {
240 return true;
241 }
242 else {
243 return false;
244 }
245 }
246
247 public int hashCode() {
248 return (int)getPrimaryKey();
249 }
250
251 private long _userTrackerPathId;
252 private long _userTrackerId;
253 private String _path;
254 private Date _pathDate;
255 }