001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.journal.model.impl;
022:
023: import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
024: import com.liferay.portal.kernel.util.GetterUtil;
025: import com.liferay.portal.model.impl.BaseModelImpl;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.portlet.journal.model.JournalTemplate;
029:
030: import com.liferay.util.Html;
031:
032: import java.io.Serializable;
033:
034: import java.lang.reflect.Proxy;
035:
036: import java.sql.Types;
037:
038: import java.util.Date;
039:
040: /**
041: * <a href="JournalTemplateModelImpl.java.html"><b><i>View Source</i></b></a>
042: *
043: * <p>
044: * ServiceBuilder generated this class. Modifications in this class will be
045: * overwritten the next time is generated.
046: * </p>
047: *
048: * <p>
049: * This class is a model that represents the <code>JournalTemplate</code> table
050: * in the database.
051: * </p>
052: *
053: * @author Brian Wing Shun Chan
054: *
055: * @see com.liferay.portlet.journal.service.model.JournalTemplate
056: * @see com.liferay.portlet.journal.service.model.JournalTemplateModel
057: * @see com.liferay.portlet.journal.service.model.impl.JournalTemplateImpl
058: *
059: */
060: public class JournalTemplateModelImpl extends BaseModelImpl {
061: public static final String TABLE_NAME = "JournalTemplate";
062: public static final Object[][] TABLE_COLUMNS = {
063: { "uuid_", new Integer(Types.VARCHAR) },
064:
065: { "id_", new Integer(Types.BIGINT) },
066:
067: { "groupId", new Integer(Types.BIGINT) },
068:
069: { "companyId", new Integer(Types.BIGINT) },
070:
071: { "userId", new Integer(Types.BIGINT) },
072:
073: { "userName", new Integer(Types.VARCHAR) },
074:
075: { "createDate", new Integer(Types.TIMESTAMP) },
076:
077: { "modifiedDate", new Integer(Types.TIMESTAMP) },
078:
079: { "templateId", new Integer(Types.VARCHAR) },
080:
081: { "structureId", new Integer(Types.VARCHAR) },
082:
083: { "name", new Integer(Types.VARCHAR) },
084:
085: { "description", new Integer(Types.VARCHAR) },
086:
087: { "xsl", new Integer(Types.CLOB) },
088:
089: { "langType", new Integer(Types.VARCHAR) },
090:
091: { "cacheable", new Integer(Types.BOOLEAN) },
092:
093: { "smallImage", new Integer(Types.BOOLEAN) },
094:
095: { "smallImageId", new Integer(Types.BIGINT) },
096:
097: { "smallImageURL", new Integer(Types.VARCHAR) } };
098: public static final String TABLE_SQL_CREATE = "create table JournalTemplate (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,templateId VARCHAR(75) null,structureId VARCHAR(75) null,name VARCHAR(75) null,description STRING null,xsl TEXT null,langType VARCHAR(75) null,cacheable BOOLEAN,smallImage BOOLEAN,smallImageId LONG,smallImageURL VARCHAR(75) null)";
099: public static final String TABLE_SQL_DROP = "drop table JournalTemplate";
100: public static final boolean CACHE_ENABLED = GetterUtil
101: .getBoolean(
102: PropsUtil
103: .get("value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalTemplate"),
104: true);
105: public static final long LOCK_EXPIRATION_TIME = GetterUtil
106: .getLong(PropsUtil
107: .get("lock.expiration.time.com.liferay.portlet.journal.model.JournalTemplate"));
108:
109: public JournalTemplateModelImpl() {
110: }
111:
112: public long getPrimaryKey() {
113: return _id;
114: }
115:
116: public void setPrimaryKey(long pk) {
117: setId(pk);
118: }
119:
120: public Serializable getPrimaryKeyObj() {
121: return new Long(_id);
122: }
123:
124: public String getUuid() {
125: return GetterUtil.getString(_uuid);
126: }
127:
128: public void setUuid(String uuid) {
129: if ((uuid != null) && (uuid != _uuid)) {
130: _uuid = uuid;
131: }
132: }
133:
134: public long getId() {
135: return _id;
136: }
137:
138: public void setId(long id) {
139: if (id != _id) {
140: _id = id;
141: }
142: }
143:
144: public long getGroupId() {
145: return _groupId;
146: }
147:
148: public void setGroupId(long groupId) {
149: if (groupId != _groupId) {
150: _groupId = groupId;
151: }
152: }
153:
154: public long getCompanyId() {
155: return _companyId;
156: }
157:
158: public void setCompanyId(long companyId) {
159: if (companyId != _companyId) {
160: _companyId = companyId;
161: }
162: }
163:
164: public long getUserId() {
165: return _userId;
166: }
167:
168: public void setUserId(long userId) {
169: if (userId != _userId) {
170: _userId = userId;
171: }
172: }
173:
174: public String getUserName() {
175: return GetterUtil.getString(_userName);
176: }
177:
178: public void setUserName(String userName) {
179: if (((userName == null) && (_userName != null))
180: || ((userName != null) && (_userName == null))
181: || ((userName != null) && (_userName != null) && !userName
182: .equals(_userName))) {
183: _userName = userName;
184: }
185: }
186:
187: public Date getCreateDate() {
188: return _createDate;
189: }
190:
191: public void setCreateDate(Date createDate) {
192: if (((createDate == null) && (_createDate != null))
193: || ((createDate != null) && (_createDate == null))
194: || ((createDate != null) && (_createDate != null) && !createDate
195: .equals(_createDate))) {
196: _createDate = createDate;
197: }
198: }
199:
200: public Date getModifiedDate() {
201: return _modifiedDate;
202: }
203:
204: public void setModifiedDate(Date modifiedDate) {
205: if (((modifiedDate == null) && (_modifiedDate != null))
206: || ((modifiedDate != null) && (_modifiedDate == null))
207: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
208: .equals(_modifiedDate))) {
209: _modifiedDate = modifiedDate;
210: }
211: }
212:
213: public String getTemplateId() {
214: return GetterUtil.getString(_templateId);
215: }
216:
217: public void setTemplateId(String templateId) {
218: if (((templateId == null) && (_templateId != null))
219: || ((templateId != null) && (_templateId == null))
220: || ((templateId != null) && (_templateId != null) && !templateId
221: .equals(_templateId))) {
222: _templateId = templateId;
223: }
224: }
225:
226: public String getStructureId() {
227: return GetterUtil.getString(_structureId);
228: }
229:
230: public void setStructureId(String structureId) {
231: if (((structureId == null) && (_structureId != null))
232: || ((structureId != null) && (_structureId == null))
233: || ((structureId != null) && (_structureId != null) && !structureId
234: .equals(_structureId))) {
235: _structureId = structureId;
236: }
237: }
238:
239: public String getName() {
240: return GetterUtil.getString(_name);
241: }
242:
243: public void setName(String name) {
244: if (((name == null) && (_name != null))
245: || ((name != null) && (_name == null))
246: || ((name != null) && (_name != null) && !name
247: .equals(_name))) {
248: _name = name;
249: }
250: }
251:
252: public String getDescription() {
253: return GetterUtil.getString(_description);
254: }
255:
256: public void setDescription(String description) {
257: if (((description == null) && (_description != null))
258: || ((description != null) && (_description == null))
259: || ((description != null) && (_description != null) && !description
260: .equals(_description))) {
261: _description = description;
262: }
263: }
264:
265: public String getXsl() {
266: return GetterUtil.getString(_xsl);
267: }
268:
269: public void setXsl(String xsl) {
270: if (((xsl == null) && (_xsl != null))
271: || ((xsl != null) && (_xsl == null))
272: || ((xsl != null) && (_xsl != null) && !xsl
273: .equals(_xsl))) {
274: _xsl = xsl;
275: }
276: }
277:
278: public String getLangType() {
279: return GetterUtil.getString(_langType);
280: }
281:
282: public void setLangType(String langType) {
283: if (((langType == null) && (_langType != null))
284: || ((langType != null) && (_langType == null))
285: || ((langType != null) && (_langType != null) && !langType
286: .equals(_langType))) {
287: _langType = langType;
288: }
289: }
290:
291: public boolean getCacheable() {
292: return _cacheable;
293: }
294:
295: public boolean isCacheable() {
296: return _cacheable;
297: }
298:
299: public void setCacheable(boolean cacheable) {
300: if (cacheable != _cacheable) {
301: _cacheable = cacheable;
302: }
303: }
304:
305: public boolean getSmallImage() {
306: return _smallImage;
307: }
308:
309: public boolean isSmallImage() {
310: return _smallImage;
311: }
312:
313: public void setSmallImage(boolean smallImage) {
314: if (smallImage != _smallImage) {
315: _smallImage = smallImage;
316: }
317: }
318:
319: public long getSmallImageId() {
320: return _smallImageId;
321: }
322:
323: public void setSmallImageId(long smallImageId) {
324: if (smallImageId != _smallImageId) {
325: _smallImageId = smallImageId;
326: }
327: }
328:
329: public String getSmallImageURL() {
330: return GetterUtil.getString(_smallImageURL);
331: }
332:
333: public void setSmallImageURL(String smallImageURL) {
334: if (((smallImageURL == null) && (_smallImageURL != null))
335: || ((smallImageURL != null) && (_smallImageURL == null))
336: || ((smallImageURL != null) && (_smallImageURL != null) && !smallImageURL
337: .equals(_smallImageURL))) {
338: _smallImageURL = smallImageURL;
339: }
340: }
341:
342: public JournalTemplate toEscapedModel() {
343: if (isEscapedModel()) {
344: return (JournalTemplate) this ;
345: } else {
346: JournalTemplate model = new JournalTemplateImpl();
347:
348: model.setEscapedModel(true);
349:
350: model.setUuid(Html.escape(getUuid()));
351: model.setId(getId());
352: model.setGroupId(getGroupId());
353: model.setCompanyId(getCompanyId());
354: model.setUserId(getUserId());
355: model.setUserName(Html.escape(getUserName()));
356: model.setCreateDate(getCreateDate());
357: model.setModifiedDate(getModifiedDate());
358: model.setTemplateId(getTemplateId());
359: model.setStructureId(getStructureId());
360: model.setName(Html.escape(getName()));
361: model.setDescription(Html.escape(getDescription()));
362: model.setXsl(Html.escape(getXsl()));
363: model.setLangType(Html.escape(getLangType()));
364: model.setCacheable(getCacheable());
365: model.setSmallImage(getSmallImage());
366: model.setSmallImageId(getSmallImageId());
367: model.setSmallImageURL(Html.escape(getSmallImageURL()));
368:
369: model = (JournalTemplate) Proxy.newProxyInstance(
370: JournalTemplate.class.getClassLoader(),
371: new Class[] { JournalTemplate.class },
372: new ReadOnlyBeanHandler(model));
373:
374: return model;
375: }
376: }
377:
378: public Object clone() {
379: JournalTemplateImpl clone = new JournalTemplateImpl();
380:
381: clone.setUuid(getUuid());
382: clone.setId(getId());
383: clone.setGroupId(getGroupId());
384: clone.setCompanyId(getCompanyId());
385: clone.setUserId(getUserId());
386: clone.setUserName(getUserName());
387: clone.setCreateDate(getCreateDate());
388: clone.setModifiedDate(getModifiedDate());
389: clone.setTemplateId(getTemplateId());
390: clone.setStructureId(getStructureId());
391: clone.setName(getName());
392: clone.setDescription(getDescription());
393: clone.setXsl(getXsl());
394: clone.setLangType(getLangType());
395: clone.setCacheable(getCacheable());
396: clone.setSmallImage(getSmallImage());
397: clone.setSmallImageId(getSmallImageId());
398: clone.setSmallImageURL(getSmallImageURL());
399:
400: return clone;
401: }
402:
403: public int compareTo(Object obj) {
404: if (obj == null) {
405: return -1;
406: }
407:
408: JournalTemplateImpl journalTemplate = (JournalTemplateImpl) obj;
409:
410: int value = 0;
411:
412: value = getTemplateId().compareTo(
413: journalTemplate.getTemplateId());
414:
415: if (value != 0) {
416: return value;
417: }
418:
419: return 0;
420: }
421:
422: public boolean equals(Object obj) {
423: if (obj == null) {
424: return false;
425: }
426:
427: JournalTemplateImpl journalTemplate = null;
428:
429: try {
430: journalTemplate = (JournalTemplateImpl) obj;
431: } catch (ClassCastException cce) {
432: return false;
433: }
434:
435: long pk = journalTemplate.getPrimaryKey();
436:
437: if (getPrimaryKey() == pk) {
438: return true;
439: } else {
440: return false;
441: }
442: }
443:
444: public int hashCode() {
445: return (int) getPrimaryKey();
446: }
447:
448: private String _uuid;
449: private long _id;
450: private long _groupId;
451: private long _companyId;
452: private long _userId;
453: private String _userName;
454: private Date _createDate;
455: private Date _modifiedDate;
456: private String _templateId;
457: private String _structureId;
458: private String _name;
459: private String _description;
460: private String _xsl;
461: private String _langType;
462: private boolean _cacheable;
463: private boolean _smallImage;
464: private long _smallImageId;
465: private String _smallImageURL;
466: }
|