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.TagsProperty;
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="TagsPropertyModelImpl.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>TagsProperty</code> table
050: * in the database.
051: * </p>
052: *
053: * @author Brian Wing Shun Chan
054: *
055: * @see com.liferay.portlet.tags.service.model.TagsProperty
056: * @see com.liferay.portlet.tags.service.model.TagsPropertyModel
057: * @see com.liferay.portlet.tags.service.model.impl.TagsPropertyImpl
058: *
059: */
060: public class TagsPropertyModelImpl extends BaseModelImpl {
061: public static final String TABLE_NAME = "TagsProperty";
062: public static final Object[][] TABLE_COLUMNS = {
063: { "propertyId", new Integer(Types.BIGINT) },
064:
065: { "companyId", new Integer(Types.BIGINT) },
066:
067: { "userId", new Integer(Types.BIGINT) },
068:
069: { "userName", new Integer(Types.VARCHAR) },
070:
071: { "createDate", new Integer(Types.TIMESTAMP) },
072:
073: { "modifiedDate", new Integer(Types.TIMESTAMP) },
074:
075: { "entryId", new Integer(Types.BIGINT) },
076:
077: { "key_", new Integer(Types.VARCHAR) },
078:
079: { "value", new Integer(Types.VARCHAR) } };
080: public static final String TABLE_SQL_CREATE = "create table TagsProperty (propertyId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,entryId LONG,key_ VARCHAR(75) null,value VARCHAR(300) null)";
081: public static final String TABLE_SQL_DROP = "drop table TagsProperty";
082: public static final boolean CACHE_ENABLED = GetterUtil
083: .getBoolean(
084: PropsUtil
085: .get("value.object.finder.cache.enabled.com.liferay.portlet.tags.model.TagsProperty"),
086: true);
087: public static final long LOCK_EXPIRATION_TIME = GetterUtil
088: .getLong(PropsUtil
089: .get("lock.expiration.time.com.liferay.portlet.tags.model.TagsProperty"));
090:
091: public TagsPropertyModelImpl() {
092: }
093:
094: public long getPrimaryKey() {
095: return _propertyId;
096: }
097:
098: public void setPrimaryKey(long pk) {
099: setPropertyId(pk);
100: }
101:
102: public Serializable getPrimaryKeyObj() {
103: return new Long(_propertyId);
104: }
105:
106: public long getPropertyId() {
107: return _propertyId;
108: }
109:
110: public void setPropertyId(long propertyId) {
111: if (propertyId != _propertyId) {
112: _propertyId = propertyId;
113: }
114: }
115:
116: public long getCompanyId() {
117: return _companyId;
118: }
119:
120: public void setCompanyId(long companyId) {
121: if (companyId != _companyId) {
122: _companyId = companyId;
123: }
124: }
125:
126: public long getUserId() {
127: return _userId;
128: }
129:
130: public void setUserId(long userId) {
131: if (userId != _userId) {
132: _userId = userId;
133: }
134: }
135:
136: public String getUserName() {
137: return GetterUtil.getString(_userName);
138: }
139:
140: public void setUserName(String userName) {
141: if (((userName == null) && (_userName != null))
142: || ((userName != null) && (_userName == null))
143: || ((userName != null) && (_userName != null) && !userName
144: .equals(_userName))) {
145: _userName = userName;
146: }
147: }
148:
149: public Date getCreateDate() {
150: return _createDate;
151: }
152:
153: public void setCreateDate(Date createDate) {
154: if (((createDate == null) && (_createDate != null))
155: || ((createDate != null) && (_createDate == null))
156: || ((createDate != null) && (_createDate != null) && !createDate
157: .equals(_createDate))) {
158: _createDate = createDate;
159: }
160: }
161:
162: public Date getModifiedDate() {
163: return _modifiedDate;
164: }
165:
166: public void setModifiedDate(Date modifiedDate) {
167: if (((modifiedDate == null) && (_modifiedDate != null))
168: || ((modifiedDate != null) && (_modifiedDate == null))
169: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
170: .equals(_modifiedDate))) {
171: _modifiedDate = modifiedDate;
172: }
173: }
174:
175: public long getEntryId() {
176: return _entryId;
177: }
178:
179: public void setEntryId(long entryId) {
180: if (entryId != _entryId) {
181: _entryId = entryId;
182: }
183: }
184:
185: public String getKey() {
186: return GetterUtil.getString(_key);
187: }
188:
189: public void setKey(String key) {
190: if (((key == null) && (_key != null))
191: || ((key != null) && (_key == null))
192: || ((key != null) && (_key != null) && !key
193: .equals(_key))) {
194: _key = key;
195: }
196: }
197:
198: public String getValue() {
199: return GetterUtil.getString(_value);
200: }
201:
202: public void setValue(String value) {
203: if (((value == null) && (_value != null))
204: || ((value != null) && (_value == null))
205: || ((value != null) && (_value != null) && !value
206: .equals(_value))) {
207: _value = value;
208: }
209: }
210:
211: public TagsProperty toEscapedModel() {
212: if (isEscapedModel()) {
213: return (TagsProperty) this ;
214: } else {
215: TagsProperty model = new TagsPropertyImpl();
216:
217: model.setEscapedModel(true);
218:
219: model.setPropertyId(getPropertyId());
220: model.setCompanyId(getCompanyId());
221: model.setUserId(getUserId());
222: model.setUserName(Html.escape(getUserName()));
223: model.setCreateDate(getCreateDate());
224: model.setModifiedDate(getModifiedDate());
225: model.setEntryId(getEntryId());
226: model.setKey(Html.escape(getKey()));
227: model.setValue(Html.escape(getValue()));
228:
229: model = (TagsProperty) Proxy.newProxyInstance(
230: TagsProperty.class.getClassLoader(),
231: new Class[] { TagsProperty.class },
232: new ReadOnlyBeanHandler(model));
233:
234: return model;
235: }
236: }
237:
238: public Object clone() {
239: TagsPropertyImpl clone = new TagsPropertyImpl();
240:
241: clone.setPropertyId(getPropertyId());
242: clone.setCompanyId(getCompanyId());
243: clone.setUserId(getUserId());
244: clone.setUserName(getUserName());
245: clone.setCreateDate(getCreateDate());
246: clone.setModifiedDate(getModifiedDate());
247: clone.setEntryId(getEntryId());
248: clone.setKey(getKey());
249: clone.setValue(getValue());
250:
251: return clone;
252: }
253:
254: public int compareTo(Object obj) {
255: if (obj == null) {
256: return -1;
257: }
258:
259: TagsPropertyImpl tagsProperty = (TagsPropertyImpl) obj;
260:
261: int value = 0;
262:
263: value = getKey().compareTo(tagsProperty.getKey());
264:
265: if (value != 0) {
266: return value;
267: }
268:
269: return 0;
270: }
271:
272: public boolean equals(Object obj) {
273: if (obj == null) {
274: return false;
275: }
276:
277: TagsPropertyImpl tagsProperty = null;
278:
279: try {
280: tagsProperty = (TagsPropertyImpl) obj;
281: } catch (ClassCastException cce) {
282: return false;
283: }
284:
285: long pk = tagsProperty.getPrimaryKey();
286:
287: if (getPrimaryKey() == pk) {
288: return true;
289: } else {
290: return false;
291: }
292: }
293:
294: public int hashCode() {
295: return (int) getPrimaryKey();
296: }
297:
298: private long _propertyId;
299: private long _companyId;
300: private long _userId;
301: private String _userName;
302: private Date _createDate;
303: private Date _modifiedDate;
304: private long _entryId;
305: private String _key;
306: private String _value;
307: }
|