1
22
23 package com.liferay.portlet.documentlibrary.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.impl.BaseModelImpl;
29
30 import com.liferay.portlet.documentlibrary.model.DLFileShortcut;
31 import com.liferay.portlet.documentlibrary.model.DLFileShortcutSoap;
32
33 import java.io.Serializable;
34
35 import java.lang.reflect.Proxy;
36
37 import java.sql.Types;
38
39 import java.util.ArrayList;
40 import java.util.Date;
41 import java.util.List;
42
43
63 public class DLFileShortcutModelImpl extends BaseModelImpl {
64 public static final String TABLE_NAME = "DLFileShortcut";
65 public static final Object[][] TABLE_COLUMNS = {
66 { "uuid_", new Integer(Types.VARCHAR) },
67
68
69 { "fileShortcutId", new Integer(Types.BIGINT) },
70
71
72 { "companyId", new Integer(Types.BIGINT) },
73
74
75 { "userId", new Integer(Types.BIGINT) },
76
77
78 { "userName", new Integer(Types.VARCHAR) },
79
80
81 { "createDate", new Integer(Types.TIMESTAMP) },
82
83
84 { "modifiedDate", new Integer(Types.TIMESTAMP) },
85
86
87 { "folderId", new Integer(Types.BIGINT) },
88
89
90 { "toFolderId", new Integer(Types.BIGINT) },
91
92
93 { "toName", new Integer(Types.VARCHAR) }
94 };
95 public static final String TABLE_SQL_CREATE = "create table DLFileShortcut (uuid_ VARCHAR(75) null,fileShortcutId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,folderId LONG,toFolderId LONG,toName VARCHAR(300) null)";
96 public static final String TABLE_SQL_DROP = "drop table DLFileShortcut";
97 public static final String DATA_SOURCE = "liferayDataSource";
98 public static final String SESSION_FACTORY = "liferaySessionFactory";
99 public static final String TX_MANAGER = "liferayTransactionManager";
100 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
101 "value.object.finder.cache.enabled.com.liferay.portlet.documentlibrary.model.DLFileShortcut"),
102 true);
103
104 public static DLFileShortcut toModel(DLFileShortcutSoap soapModel) {
105 DLFileShortcut model = new DLFileShortcutImpl();
106
107 model.setUuid(soapModel.getUuid());
108 model.setFileShortcutId(soapModel.getFileShortcutId());
109 model.setCompanyId(soapModel.getCompanyId());
110 model.setUserId(soapModel.getUserId());
111 model.setUserName(soapModel.getUserName());
112 model.setCreateDate(soapModel.getCreateDate());
113 model.setModifiedDate(soapModel.getModifiedDate());
114 model.setFolderId(soapModel.getFolderId());
115 model.setToFolderId(soapModel.getToFolderId());
116 model.setToName(soapModel.getToName());
117
118 return model;
119 }
120
121 public static List<DLFileShortcut> toModels(DLFileShortcutSoap[] soapModels) {
122 List<DLFileShortcut> models = new ArrayList<DLFileShortcut>(soapModels.length);
123
124 for (DLFileShortcutSoap soapModel : soapModels) {
125 models.add(toModel(soapModel));
126 }
127
128 return models;
129 }
130
131 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
132 "lock.expiration.time.com.liferay.portlet.documentlibrary.model.DLFileShortcut"));
133
134 public DLFileShortcutModelImpl() {
135 }
136
137 public long getPrimaryKey() {
138 return _fileShortcutId;
139 }
140
141 public void setPrimaryKey(long pk) {
142 setFileShortcutId(pk);
143 }
144
145 public Serializable getPrimaryKeyObj() {
146 return new Long(_fileShortcutId);
147 }
148
149 public String getUuid() {
150 return GetterUtil.getString(_uuid);
151 }
152
153 public void setUuid(String uuid) {
154 if ((uuid != null) && (uuid != _uuid)) {
155 _uuid = uuid;
156 }
157 }
158
159 public long getFileShortcutId() {
160 return _fileShortcutId;
161 }
162
163 public void setFileShortcutId(long fileShortcutId) {
164 if (fileShortcutId != _fileShortcutId) {
165 _fileShortcutId = fileShortcutId;
166 }
167 }
168
169 public long getCompanyId() {
170 return _companyId;
171 }
172
173 public void setCompanyId(long companyId) {
174 if (companyId != _companyId) {
175 _companyId = companyId;
176 }
177 }
178
179 public long getUserId() {
180 return _userId;
181 }
182
183 public void setUserId(long userId) {
184 if (userId != _userId) {
185 _userId = userId;
186 }
187 }
188
189 public String getUserName() {
190 return GetterUtil.getString(_userName);
191 }
192
193 public void setUserName(String userName) {
194 if (((userName == null) && (_userName != null)) ||
195 ((userName != null) && (_userName == null)) ||
196 ((userName != null) && (_userName != null) &&
197 !userName.equals(_userName))) {
198 _userName = userName;
199 }
200 }
201
202 public Date getCreateDate() {
203 return _createDate;
204 }
205
206 public void setCreateDate(Date createDate) {
207 if (((createDate == null) && (_createDate != null)) ||
208 ((createDate != null) && (_createDate == null)) ||
209 ((createDate != null) && (_createDate != null) &&
210 !createDate.equals(_createDate))) {
211 _createDate = createDate;
212 }
213 }
214
215 public Date getModifiedDate() {
216 return _modifiedDate;
217 }
218
219 public void setModifiedDate(Date modifiedDate) {
220 if (((modifiedDate == null) && (_modifiedDate != null)) ||
221 ((modifiedDate != null) && (_modifiedDate == null)) ||
222 ((modifiedDate != null) && (_modifiedDate != null) &&
223 !modifiedDate.equals(_modifiedDate))) {
224 _modifiedDate = modifiedDate;
225 }
226 }
227
228 public long getFolderId() {
229 return _folderId;
230 }
231
232 public void setFolderId(long folderId) {
233 if (folderId != _folderId) {
234 _folderId = folderId;
235 }
236 }
237
238 public long getToFolderId() {
239 return _toFolderId;
240 }
241
242 public void setToFolderId(long toFolderId) {
243 if (toFolderId != _toFolderId) {
244 _toFolderId = toFolderId;
245 }
246 }
247
248 public String getToName() {
249 return GetterUtil.getString(_toName);
250 }
251
252 public void setToName(String toName) {
253 if (((toName == null) && (_toName != null)) ||
254 ((toName != null) && (_toName == null)) ||
255 ((toName != null) && (_toName != null) &&
256 !toName.equals(_toName))) {
257 _toName = toName;
258 }
259 }
260
261 public DLFileShortcut toEscapedModel() {
262 if (isEscapedModel()) {
263 return (DLFileShortcut)this;
264 }
265 else {
266 DLFileShortcut model = new DLFileShortcutImpl();
267
268 model.setNew(isNew());
269 model.setEscapedModel(true);
270
271 model.setUuid(HtmlUtil.escape(getUuid()));
272 model.setFileShortcutId(getFileShortcutId());
273 model.setCompanyId(getCompanyId());
274 model.setUserId(getUserId());
275 model.setUserName(HtmlUtil.escape(getUserName()));
276 model.setCreateDate(getCreateDate());
277 model.setModifiedDate(getModifiedDate());
278 model.setFolderId(getFolderId());
279 model.setToFolderId(getToFolderId());
280 model.setToName(HtmlUtil.escape(getToName()));
281
282 model = (DLFileShortcut)Proxy.newProxyInstance(DLFileShortcut.class.getClassLoader(),
283 new Class[] { DLFileShortcut.class },
284 new ReadOnlyBeanHandler(model));
285
286 return model;
287 }
288 }
289
290 public Object clone() {
291 DLFileShortcutImpl clone = new DLFileShortcutImpl();
292
293 clone.setUuid(getUuid());
294 clone.setFileShortcutId(getFileShortcutId());
295 clone.setCompanyId(getCompanyId());
296 clone.setUserId(getUserId());
297 clone.setUserName(getUserName());
298 clone.setCreateDate(getCreateDate());
299 clone.setModifiedDate(getModifiedDate());
300 clone.setFolderId(getFolderId());
301 clone.setToFolderId(getToFolderId());
302 clone.setToName(getToName());
303
304 return clone;
305 }
306
307 public int compareTo(Object obj) {
308 if (obj == null) {
309 return -1;
310 }
311
312 DLFileShortcutImpl dlFileShortcut = (DLFileShortcutImpl)obj;
313
314 long pk = dlFileShortcut.getPrimaryKey();
315
316 if (getPrimaryKey() < pk) {
317 return -1;
318 }
319 else if (getPrimaryKey() > pk) {
320 return 1;
321 }
322 else {
323 return 0;
324 }
325 }
326
327 public boolean equals(Object obj) {
328 if (obj == null) {
329 return false;
330 }
331
332 DLFileShortcutImpl dlFileShortcut = null;
333
334 try {
335 dlFileShortcut = (DLFileShortcutImpl)obj;
336 }
337 catch (ClassCastException cce) {
338 return false;
339 }
340
341 long pk = dlFileShortcut.getPrimaryKey();
342
343 if (getPrimaryKey() == pk) {
344 return true;
345 }
346 else {
347 return false;
348 }
349 }
350
351 public int hashCode() {
352 return (int)getPrimaryKey();
353 }
354
355 private String _uuid;
356 private long _fileShortcutId;
357 private long _companyId;
358 private long _userId;
359 private String _userName;
360 private Date _createDate;
361 private Date _modifiedDate;
362 private long _folderId;
363 private long _toFolderId;
364 private String _toName;
365 }