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.tags.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.tags.model.TagsAsset;
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="TagsAssetModelImpl.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>TagsAsset</code> table
050: * in the database.
051: * </p>
052: *
053: * @author Brian Wing Shun Chan
054: *
055: * @see com.liferay.portlet.tags.service.model.TagsAsset
056: * @see com.liferay.portlet.tags.service.model.TagsAssetModel
057: * @see com.liferay.portlet.tags.service.model.impl.TagsAssetImpl
058: *
059: */
060: public class TagsAssetModelImpl extends BaseModelImpl {
061: public static final String TABLE_NAME = "TagsAsset";
062: public static final Object[][] TABLE_COLUMNS = {
063: { "assetId", new Integer(Types.BIGINT) },
064:
065: { "groupId", new Integer(Types.BIGINT) },
066:
067: { "companyId", new Integer(Types.BIGINT) },
068:
069: { "userId", new Integer(Types.BIGINT) },
070:
071: { "userName", new Integer(Types.VARCHAR) },
072:
073: { "createDate", new Integer(Types.TIMESTAMP) },
074:
075: { "modifiedDate", new Integer(Types.TIMESTAMP) },
076:
077: { "classNameId", new Integer(Types.BIGINT) },
078:
079: { "classPK", new Integer(Types.BIGINT) },
080:
081: { "startDate", new Integer(Types.TIMESTAMP) },
082:
083: { "endDate", new Integer(Types.TIMESTAMP) },
084:
085: { "publishDate", new Integer(Types.TIMESTAMP) },
086:
087: { "expirationDate", new Integer(Types.TIMESTAMP) },
088:
089: { "mimeType", new Integer(Types.VARCHAR) },
090:
091: { "title", new Integer(Types.VARCHAR) },
092:
093: { "description", new Integer(Types.VARCHAR) },
094:
095: { "summary", new Integer(Types.VARCHAR) },
096:
097: { "url", new Integer(Types.VARCHAR) },
098:
099: { "height", new Integer(Types.INTEGER) },
100:
101: { "width", new Integer(Types.INTEGER) },
102:
103: { "priority", new Integer(Types.DOUBLE) },
104:
105: { "viewCount", new Integer(Types.INTEGER) } };
106: public static final String TABLE_SQL_CREATE = "create table TagsAsset (assetId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,classNameId LONG,classPK LONG,startDate DATE null,endDate DATE null,publishDate DATE null,expirationDate DATE null,mimeType VARCHAR(75) null,title VARCHAR(300) null,description STRING null,summary STRING null,url STRING null,height INTEGER,width INTEGER,priority DOUBLE,viewCount INTEGER)";
107: public static final String TABLE_SQL_DROP = "drop table TagsAsset";
108: public static final boolean CACHE_ENABLED = GetterUtil
109: .getBoolean(
110: PropsUtil
111: .get("value.object.finder.cache.enabled.com.liferay.portlet.tags.model.TagsAsset"),
112: true);
113: public static final boolean CACHE_ENABLED_TAGSASSETS_TAGSENTRIES = GetterUtil
114: .getBoolean(
115: PropsUtil
116: .get("value.object.finder.cache.enabled.TagsAssets_TagsEntries"),
117: true);
118: public static final long LOCK_EXPIRATION_TIME = GetterUtil
119: .getLong(PropsUtil
120: .get("lock.expiration.time.com.liferay.portlet.tags.model.TagsAsset"));
121:
122: public TagsAssetModelImpl() {
123: }
124:
125: public long getPrimaryKey() {
126: return _assetId;
127: }
128:
129: public void setPrimaryKey(long pk) {
130: setAssetId(pk);
131: }
132:
133: public Serializable getPrimaryKeyObj() {
134: return new Long(_assetId);
135: }
136:
137: public long getAssetId() {
138: return _assetId;
139: }
140:
141: public void setAssetId(long assetId) {
142: if (assetId != _assetId) {
143: _assetId = assetId;
144: }
145: }
146:
147: public long getGroupId() {
148: return _groupId;
149: }
150:
151: public void setGroupId(long groupId) {
152: if (groupId != _groupId) {
153: _groupId = groupId;
154: }
155: }
156:
157: public long getCompanyId() {
158: return _companyId;
159: }
160:
161: public void setCompanyId(long companyId) {
162: if (companyId != _companyId) {
163: _companyId = companyId;
164: }
165: }
166:
167: public long getUserId() {
168: return _userId;
169: }
170:
171: public void setUserId(long userId) {
172: if (userId != _userId) {
173: _userId = userId;
174: }
175: }
176:
177: public String getUserName() {
178: return GetterUtil.getString(_userName);
179: }
180:
181: public void setUserName(String userName) {
182: if (((userName == null) && (_userName != null))
183: || ((userName != null) && (_userName == null))
184: || ((userName != null) && (_userName != null) && !userName
185: .equals(_userName))) {
186: _userName = userName;
187: }
188: }
189:
190: public Date getCreateDate() {
191: return _createDate;
192: }
193:
194: public void setCreateDate(Date createDate) {
195: if (((createDate == null) && (_createDate != null))
196: || ((createDate != null) && (_createDate == null))
197: || ((createDate != null) && (_createDate != null) && !createDate
198: .equals(_createDate))) {
199: _createDate = createDate;
200: }
201: }
202:
203: public Date getModifiedDate() {
204: return _modifiedDate;
205: }
206:
207: public void setModifiedDate(Date modifiedDate) {
208: if (((modifiedDate == null) && (_modifiedDate != null))
209: || ((modifiedDate != null) && (_modifiedDate == null))
210: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
211: .equals(_modifiedDate))) {
212: _modifiedDate = modifiedDate;
213: }
214: }
215:
216: public long getClassNameId() {
217: return _classNameId;
218: }
219:
220: public void setClassNameId(long classNameId) {
221: if (classNameId != _classNameId) {
222: _classNameId = classNameId;
223: }
224: }
225:
226: public long getClassPK() {
227: return _classPK;
228: }
229:
230: public void setClassPK(long classPK) {
231: if (classPK != _classPK) {
232: _classPK = classPK;
233: }
234: }
235:
236: public Date getStartDate() {
237: return _startDate;
238: }
239:
240: public void setStartDate(Date startDate) {
241: if (((startDate == null) && (_startDate != null))
242: || ((startDate != null) && (_startDate == null))
243: || ((startDate != null) && (_startDate != null) && !startDate
244: .equals(_startDate))) {
245: _startDate = startDate;
246: }
247: }
248:
249: public Date getEndDate() {
250: return _endDate;
251: }
252:
253: public void setEndDate(Date endDate) {
254: if (((endDate == null) && (_endDate != null))
255: || ((endDate != null) && (_endDate == null))
256: || ((endDate != null) && (_endDate != null) && !endDate
257: .equals(_endDate))) {
258: _endDate = endDate;
259: }
260: }
261:
262: public Date getPublishDate() {
263: return _publishDate;
264: }
265:
266: public void setPublishDate(Date publishDate) {
267: if (((publishDate == null) && (_publishDate != null))
268: || ((publishDate != null) && (_publishDate == null))
269: || ((publishDate != null) && (_publishDate != null) && !publishDate
270: .equals(_publishDate))) {
271: _publishDate = publishDate;
272: }
273: }
274:
275: public Date getExpirationDate() {
276: return _expirationDate;
277: }
278:
279: public void setExpirationDate(Date expirationDate) {
280: if (((expirationDate == null) && (_expirationDate != null))
281: || ((expirationDate != null) && (_expirationDate == null))
282: || ((expirationDate != null)
283: && (_expirationDate != null) && !expirationDate
284: .equals(_expirationDate))) {
285: _expirationDate = expirationDate;
286: }
287: }
288:
289: public String getMimeType() {
290: return GetterUtil.getString(_mimeType);
291: }
292:
293: public void setMimeType(String mimeType) {
294: if (((mimeType == null) && (_mimeType != null))
295: || ((mimeType != null) && (_mimeType == null))
296: || ((mimeType != null) && (_mimeType != null) && !mimeType
297: .equals(_mimeType))) {
298: _mimeType = mimeType;
299: }
300: }
301:
302: public String getTitle() {
303: return GetterUtil.getString(_title);
304: }
305:
306: public void setTitle(String title) {
307: if (((title == null) && (_title != null))
308: || ((title != null) && (_title == null))
309: || ((title != null) && (_title != null) && !title
310: .equals(_title))) {
311: _title = title;
312: }
313: }
314:
315: public String getDescription() {
316: return GetterUtil.getString(_description);
317: }
318:
319: public void setDescription(String description) {
320: if (((description == null) && (_description != null))
321: || ((description != null) && (_description == null))
322: || ((description != null) && (_description != null) && !description
323: .equals(_description))) {
324: _description = description;
325: }
326: }
327:
328: public String getSummary() {
329: return GetterUtil.getString(_summary);
330: }
331:
332: public void setSummary(String summary) {
333: if (((summary == null) && (_summary != null))
334: || ((summary != null) && (_summary == null))
335: || ((summary != null) && (_summary != null) && !summary
336: .equals(_summary))) {
337: _summary = summary;
338: }
339: }
340:
341: public String getUrl() {
342: return GetterUtil.getString(_url);
343: }
344:
345: public void setUrl(String url) {
346: if (((url == null) && (_url != null))
347: || ((url != null) && (_url == null))
348: || ((url != null) && (_url != null) && !url
349: .equals(_url))) {
350: _url = url;
351: }
352: }
353:
354: public int getHeight() {
355: return _height;
356: }
357:
358: public void setHeight(int height) {
359: if (height != _height) {
360: _height = height;
361: }
362: }
363:
364: public int getWidth() {
365: return _width;
366: }
367:
368: public void setWidth(int width) {
369: if (width != _width) {
370: _width = width;
371: }
372: }
373:
374: public double getPriority() {
375: return _priority;
376: }
377:
378: public void setPriority(double priority) {
379: if (priority != _priority) {
380: _priority = priority;
381: }
382: }
383:
384: public int getViewCount() {
385: return _viewCount;
386: }
387:
388: public void setViewCount(int viewCount) {
389: if (viewCount != _viewCount) {
390: _viewCount = viewCount;
391: }
392: }
393:
394: public TagsAsset toEscapedModel() {
395: if (isEscapedModel()) {
396: return (TagsAsset) this ;
397: } else {
398: TagsAsset model = new TagsAssetImpl();
399:
400: model.setEscapedModel(true);
401:
402: model.setAssetId(getAssetId());
403: model.setGroupId(getGroupId());
404: model.setCompanyId(getCompanyId());
405: model.setUserId(getUserId());
406: model.setUserName(Html.escape(getUserName()));
407: model.setCreateDate(getCreateDate());
408: model.setModifiedDate(getModifiedDate());
409: model.setClassNameId(getClassNameId());
410: model.setClassPK(getClassPK());
411: model.setStartDate(getStartDate());
412: model.setEndDate(getEndDate());
413: model.setPublishDate(getPublishDate());
414: model.setExpirationDate(getExpirationDate());
415: model.setMimeType(Html.escape(getMimeType()));
416: model.setTitle(Html.escape(getTitle()));
417: model.setDescription(Html.escape(getDescription()));
418: model.setSummary(Html.escape(getSummary()));
419: model.setUrl(Html.escape(getUrl()));
420: model.setHeight(getHeight());
421: model.setWidth(getWidth());
422: model.setPriority(getPriority());
423: model.setViewCount(getViewCount());
424:
425: model = (TagsAsset) Proxy.newProxyInstance(TagsAsset.class
426: .getClassLoader(), new Class[] { TagsAsset.class },
427: new ReadOnlyBeanHandler(model));
428:
429: return model;
430: }
431: }
432:
433: public Object clone() {
434: TagsAssetImpl clone = new TagsAssetImpl();
435:
436: clone.setAssetId(getAssetId());
437: clone.setGroupId(getGroupId());
438: clone.setCompanyId(getCompanyId());
439: clone.setUserId(getUserId());
440: clone.setUserName(getUserName());
441: clone.setCreateDate(getCreateDate());
442: clone.setModifiedDate(getModifiedDate());
443: clone.setClassNameId(getClassNameId());
444: clone.setClassPK(getClassPK());
445: clone.setStartDate(getStartDate());
446: clone.setEndDate(getEndDate());
447: clone.setPublishDate(getPublishDate());
448: clone.setExpirationDate(getExpirationDate());
449: clone.setMimeType(getMimeType());
450: clone.setTitle(getTitle());
451: clone.setDescription(getDescription());
452: clone.setSummary(getSummary());
453: clone.setUrl(getUrl());
454: clone.setHeight(getHeight());
455: clone.setWidth(getWidth());
456: clone.setPriority(getPriority());
457: clone.setViewCount(getViewCount());
458:
459: return clone;
460: }
461:
462: public int compareTo(Object obj) {
463: if (obj == null) {
464: return -1;
465: }
466:
467: TagsAssetImpl tagsAsset = (TagsAssetImpl) obj;
468:
469: long pk = tagsAsset.getPrimaryKey();
470:
471: if (getPrimaryKey() < pk) {
472: return -1;
473: } else if (getPrimaryKey() > pk) {
474: return 1;
475: } else {
476: return 0;
477: }
478: }
479:
480: public boolean equals(Object obj) {
481: if (obj == null) {
482: return false;
483: }
484:
485: TagsAssetImpl tagsAsset = null;
486:
487: try {
488: tagsAsset = (TagsAssetImpl) obj;
489: } catch (ClassCastException cce) {
490: return false;
491: }
492:
493: long pk = tagsAsset.getPrimaryKey();
494:
495: if (getPrimaryKey() == pk) {
496: return true;
497: } else {
498: return false;
499: }
500: }
501:
502: public int hashCode() {
503: return (int) getPrimaryKey();
504: }
505:
506: private long _assetId;
507: private long _groupId;
508: private long _companyId;
509: private long _userId;
510: private String _userName;
511: private Date _createDate;
512: private Date _modifiedDate;
513: private long _classNameId;
514: private long _classPK;
515: private Date _startDate;
516: private Date _endDate;
517: private Date _publishDate;
518: private Date _expirationDate;
519: private String _mimeType;
520: private String _title;
521: private String _description;
522: private String _summary;
523: private String _url;
524: private int _height;
525: private int _width;
526: private double _priority;
527: private int _viewCount;
528: }
|