1
22
23 package com.liferay.portlet.journal.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.journal.model.JournalStructure;
31 import com.liferay.portlet.journal.model.JournalStructureSoap;
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 JournalStructureModelImpl extends BaseModelImpl {
64 public static final String TABLE_NAME = "JournalStructure";
65 public static final Object[][] TABLE_COLUMNS = {
66 { "uuid_", new Integer(Types.VARCHAR) },
67
68
69 { "id_", new Integer(Types.BIGINT) },
70
71
72 { "groupId", new Integer(Types.BIGINT) },
73
74
75 { "companyId", new Integer(Types.BIGINT) },
76
77
78 { "userId", new Integer(Types.BIGINT) },
79
80
81 { "userName", new Integer(Types.VARCHAR) },
82
83
84 { "createDate", new Integer(Types.TIMESTAMP) },
85
86
87 { "modifiedDate", new Integer(Types.TIMESTAMP) },
88
89
90 { "structureId", new Integer(Types.VARCHAR) },
91
92
93 { "name", new Integer(Types.VARCHAR) },
94
95
96 { "description", new Integer(Types.VARCHAR) },
97
98
99 { "xsd", new Integer(Types.CLOB) }
100 };
101 public static final String TABLE_SQL_CREATE = "create table JournalStructure (uuid_ VARCHAR(75) null,id_ LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,structureId VARCHAR(75) null,name VARCHAR(75) null,description STRING null,xsd TEXT null)";
102 public static final String TABLE_SQL_DROP = "drop table JournalStructure";
103 public static final String DATA_SOURCE = "liferayDataSource";
104 public static final String SESSION_FACTORY = "liferaySessionFactory";
105 public static final String TX_MANAGER = "liferayTransactionManager";
106 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
107 "value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalStructure"),
108 true);
109
110 public static JournalStructure toModel(JournalStructureSoap soapModel) {
111 JournalStructure model = new JournalStructureImpl();
112
113 model.setUuid(soapModel.getUuid());
114 model.setId(soapModel.getId());
115 model.setGroupId(soapModel.getGroupId());
116 model.setCompanyId(soapModel.getCompanyId());
117 model.setUserId(soapModel.getUserId());
118 model.setUserName(soapModel.getUserName());
119 model.setCreateDate(soapModel.getCreateDate());
120 model.setModifiedDate(soapModel.getModifiedDate());
121 model.setStructureId(soapModel.getStructureId());
122 model.setName(soapModel.getName());
123 model.setDescription(soapModel.getDescription());
124 model.setXsd(soapModel.getXsd());
125
126 return model;
127 }
128
129 public static List<JournalStructure> toModels(
130 JournalStructureSoap[] soapModels) {
131 List<JournalStructure> models = new ArrayList<JournalStructure>(soapModels.length);
132
133 for (JournalStructureSoap soapModel : soapModels) {
134 models.add(toModel(soapModel));
135 }
136
137 return models;
138 }
139
140 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
141 "lock.expiration.time.com.liferay.portlet.journal.model.JournalStructure"));
142
143 public JournalStructureModelImpl() {
144 }
145
146 public long getPrimaryKey() {
147 return _id;
148 }
149
150 public void setPrimaryKey(long pk) {
151 setId(pk);
152 }
153
154 public Serializable getPrimaryKeyObj() {
155 return new Long(_id);
156 }
157
158 public String getUuid() {
159 return GetterUtil.getString(_uuid);
160 }
161
162 public void setUuid(String uuid) {
163 if ((uuid != null) && (uuid != _uuid)) {
164 _uuid = uuid;
165 }
166 }
167
168 public long getId() {
169 return _id;
170 }
171
172 public void setId(long id) {
173 if (id != _id) {
174 _id = id;
175 }
176 }
177
178 public long getGroupId() {
179 return _groupId;
180 }
181
182 public void setGroupId(long groupId) {
183 if (groupId != _groupId) {
184 _groupId = groupId;
185 }
186 }
187
188 public long getCompanyId() {
189 return _companyId;
190 }
191
192 public void setCompanyId(long companyId) {
193 if (companyId != _companyId) {
194 _companyId = companyId;
195 }
196 }
197
198 public long getUserId() {
199 return _userId;
200 }
201
202 public void setUserId(long userId) {
203 if (userId != _userId) {
204 _userId = userId;
205 }
206 }
207
208 public String getUserName() {
209 return GetterUtil.getString(_userName);
210 }
211
212 public void setUserName(String userName) {
213 if (((userName == null) && (_userName != null)) ||
214 ((userName != null) && (_userName == null)) ||
215 ((userName != null) && (_userName != null) &&
216 !userName.equals(_userName))) {
217 _userName = userName;
218 }
219 }
220
221 public Date getCreateDate() {
222 return _createDate;
223 }
224
225 public void setCreateDate(Date createDate) {
226 if (((createDate == null) && (_createDate != null)) ||
227 ((createDate != null) && (_createDate == null)) ||
228 ((createDate != null) && (_createDate != null) &&
229 !createDate.equals(_createDate))) {
230 _createDate = createDate;
231 }
232 }
233
234 public Date getModifiedDate() {
235 return _modifiedDate;
236 }
237
238 public void setModifiedDate(Date modifiedDate) {
239 if (((modifiedDate == null) && (_modifiedDate != null)) ||
240 ((modifiedDate != null) && (_modifiedDate == null)) ||
241 ((modifiedDate != null) && (_modifiedDate != null) &&
242 !modifiedDate.equals(_modifiedDate))) {
243 _modifiedDate = modifiedDate;
244 }
245 }
246
247 public String getStructureId() {
248 return GetterUtil.getString(_structureId);
249 }
250
251 public void setStructureId(String structureId) {
252 if (((structureId == null) && (_structureId != null)) ||
253 ((structureId != null) && (_structureId == null)) ||
254 ((structureId != null) && (_structureId != null) &&
255 !structureId.equals(_structureId))) {
256 _structureId = structureId;
257 }
258 }
259
260 public String getName() {
261 return GetterUtil.getString(_name);
262 }
263
264 public void setName(String name) {
265 if (((name == null) && (_name != null)) ||
266 ((name != null) && (_name == null)) ||
267 ((name != null) && (_name != null) && !name.equals(_name))) {
268 _name = name;
269 }
270 }
271
272 public String getDescription() {
273 return GetterUtil.getString(_description);
274 }
275
276 public void setDescription(String description) {
277 if (((description == null) && (_description != null)) ||
278 ((description != null) && (_description == null)) ||
279 ((description != null) && (_description != null) &&
280 !description.equals(_description))) {
281 _description = description;
282 }
283 }
284
285 public String getXsd() {
286 return GetterUtil.getString(_xsd);
287 }
288
289 public void setXsd(String xsd) {
290 if (((xsd == null) && (_xsd != null)) ||
291 ((xsd != null) && (_xsd == null)) ||
292 ((xsd != null) && (_xsd != null) && !xsd.equals(_xsd))) {
293 _xsd = xsd;
294 }
295 }
296
297 public JournalStructure toEscapedModel() {
298 if (isEscapedModel()) {
299 return (JournalStructure)this;
300 }
301 else {
302 JournalStructure model = new JournalStructureImpl();
303
304 model.setNew(isNew());
305 model.setEscapedModel(true);
306
307 model.setUuid(HtmlUtil.escape(getUuid()));
308 model.setId(getId());
309 model.setGroupId(getGroupId());
310 model.setCompanyId(getCompanyId());
311 model.setUserId(getUserId());
312 model.setUserName(HtmlUtil.escape(getUserName()));
313 model.setCreateDate(getCreateDate());
314 model.setModifiedDate(getModifiedDate());
315 model.setStructureId(getStructureId());
316 model.setName(HtmlUtil.escape(getName()));
317 model.setDescription(HtmlUtil.escape(getDescription()));
318 model.setXsd(HtmlUtil.escape(getXsd()));
319
320 model = (JournalStructure)Proxy.newProxyInstance(JournalStructure.class.getClassLoader(),
321 new Class[] { JournalStructure.class },
322 new ReadOnlyBeanHandler(model));
323
324 return model;
325 }
326 }
327
328 public Object clone() {
329 JournalStructureImpl clone = new JournalStructureImpl();
330
331 clone.setUuid(getUuid());
332 clone.setId(getId());
333 clone.setGroupId(getGroupId());
334 clone.setCompanyId(getCompanyId());
335 clone.setUserId(getUserId());
336 clone.setUserName(getUserName());
337 clone.setCreateDate(getCreateDate());
338 clone.setModifiedDate(getModifiedDate());
339 clone.setStructureId(getStructureId());
340 clone.setName(getName());
341 clone.setDescription(getDescription());
342 clone.setXsd(getXsd());
343
344 return clone;
345 }
346
347 public int compareTo(Object obj) {
348 if (obj == null) {
349 return -1;
350 }
351
352 JournalStructureImpl journalStructure = (JournalStructureImpl)obj;
353
354 int value = 0;
355
356 value = getStructureId().compareTo(journalStructure.getStructureId());
357
358 if (value != 0) {
359 return value;
360 }
361
362 return 0;
363 }
364
365 public boolean equals(Object obj) {
366 if (obj == null) {
367 return false;
368 }
369
370 JournalStructureImpl journalStructure = null;
371
372 try {
373 journalStructure = (JournalStructureImpl)obj;
374 }
375 catch (ClassCastException cce) {
376 return false;
377 }
378
379 long pk = journalStructure.getPrimaryKey();
380
381 if (getPrimaryKey() == pk) {
382 return true;
383 }
384 else {
385 return false;
386 }
387 }
388
389 public int hashCode() {
390 return (int)getPrimaryKey();
391 }
392
393 private String _uuid;
394 private long _id;
395 private long _groupId;
396 private long _companyId;
397 private long _userId;
398 private String _userName;
399 private Date _createDate;
400 private Date _modifiedDate;
401 private String _structureId;
402 private String _name;
403 private String _description;
404 private String _xsd;
405 }