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