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.portal.model.impl;
022:
023: import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
024: import com.liferay.portal.kernel.util.DateUtil;
025: import com.liferay.portal.kernel.util.GetterUtil;
026: import com.liferay.portal.model.MembershipRequest;
027: import com.liferay.portal.util.PropsUtil;
028:
029: import com.liferay.util.Html;
030:
031: import java.io.Serializable;
032:
033: import java.lang.reflect.Proxy;
034:
035: import java.sql.Types;
036:
037: import java.util.Date;
038:
039: /**
040: * <a href="MembershipRequestModelImpl.java.html"><b><i>View Source</i></b></a>
041: *
042: * <p>
043: * ServiceBuilder generated this class. Modifications in this class will be
044: * overwritten the next time is generated.
045: * </p>
046: *
047: * <p>
048: * This class is a model that represents the <code>MembershipRequest</code> table
049: * in the database.
050: * </p>
051: *
052: * @author Brian Wing Shun Chan
053: *
054: * @see com.liferay.portal.service.model.MembershipRequest
055: * @see com.liferay.portal.service.model.MembershipRequestModel
056: * @see com.liferay.portal.service.model.impl.MembershipRequestImpl
057: *
058: */
059: public class MembershipRequestModelImpl extends BaseModelImpl {
060: public static final String TABLE_NAME = "MembershipRequest";
061: public static final Object[][] TABLE_COLUMNS = {
062: { "membershipRequestId", new Integer(Types.BIGINT) },
063:
064: { "companyId", new Integer(Types.BIGINT) },
065:
066: { "userId", new Integer(Types.BIGINT) },
067:
068: { "createDate", new Integer(Types.TIMESTAMP) },
069:
070: { "groupId", new Integer(Types.BIGINT) },
071:
072: { "comments", new Integer(Types.VARCHAR) },
073:
074: { "replyComments", new Integer(Types.VARCHAR) },
075:
076: { "replyDate", new Integer(Types.TIMESTAMP) },
077:
078: { "replierUserId", new Integer(Types.BIGINT) },
079:
080: { "statusId", new Integer(Types.INTEGER) } };
081: public static final String TABLE_SQL_CREATE = "create table MembershipRequest (membershipRequestId LONG not null primary key,companyId LONG,userId LONG,createDate DATE null,groupId LONG,comments STRING null,replyComments STRING null,replyDate DATE null,replierUserId LONG,statusId INTEGER)";
082: public static final String TABLE_SQL_DROP = "drop table MembershipRequest";
083: public static final boolean CACHE_ENABLED = GetterUtil
084: .getBoolean(
085: PropsUtil
086: .get("value.object.finder.cache.enabled.com.liferay.portal.model.MembershipRequest"),
087: true);
088: public static final long LOCK_EXPIRATION_TIME = GetterUtil
089: .getLong(PropsUtil
090: .get("lock.expiration.time.com.liferay.portal.model.MembershipRequest"));
091:
092: public MembershipRequestModelImpl() {
093: }
094:
095: public long getPrimaryKey() {
096: return _membershipRequestId;
097: }
098:
099: public void setPrimaryKey(long pk) {
100: setMembershipRequestId(pk);
101: }
102:
103: public Serializable getPrimaryKeyObj() {
104: return new Long(_membershipRequestId);
105: }
106:
107: public long getMembershipRequestId() {
108: return _membershipRequestId;
109: }
110:
111: public void setMembershipRequestId(long membershipRequestId) {
112: if (membershipRequestId != _membershipRequestId) {
113: _membershipRequestId = membershipRequestId;
114: }
115: }
116:
117: public long getCompanyId() {
118: return _companyId;
119: }
120:
121: public void setCompanyId(long companyId) {
122: if (companyId != _companyId) {
123: _companyId = companyId;
124: }
125: }
126:
127: public long getUserId() {
128: return _userId;
129: }
130:
131: public void setUserId(long userId) {
132: if (userId != _userId) {
133: _userId = userId;
134: }
135: }
136:
137: public Date getCreateDate() {
138: return _createDate;
139: }
140:
141: public void setCreateDate(Date createDate) {
142: if (((createDate == null) && (_createDate != null))
143: || ((createDate != null) && (_createDate == null))
144: || ((createDate != null) && (_createDate != null) && !createDate
145: .equals(_createDate))) {
146: _createDate = createDate;
147: }
148: }
149:
150: public long getGroupId() {
151: return _groupId;
152: }
153:
154: public void setGroupId(long groupId) {
155: if (groupId != _groupId) {
156: _groupId = groupId;
157: }
158: }
159:
160: public String getComments() {
161: return GetterUtil.getString(_comments);
162: }
163:
164: public void setComments(String comments) {
165: if (((comments == null) && (_comments != null))
166: || ((comments != null) && (_comments == null))
167: || ((comments != null) && (_comments != null) && !comments
168: .equals(_comments))) {
169: _comments = comments;
170: }
171: }
172:
173: public String getReplyComments() {
174: return GetterUtil.getString(_replyComments);
175: }
176:
177: public void setReplyComments(String replyComments) {
178: if (((replyComments == null) && (_replyComments != null))
179: || ((replyComments != null) && (_replyComments == null))
180: || ((replyComments != null) && (_replyComments != null) && !replyComments
181: .equals(_replyComments))) {
182: _replyComments = replyComments;
183: }
184: }
185:
186: public Date getReplyDate() {
187: return _replyDate;
188: }
189:
190: public void setReplyDate(Date replyDate) {
191: if (((replyDate == null) && (_replyDate != null))
192: || ((replyDate != null) && (_replyDate == null))
193: || ((replyDate != null) && (_replyDate != null) && !replyDate
194: .equals(_replyDate))) {
195: _replyDate = replyDate;
196: }
197: }
198:
199: public long getReplierUserId() {
200: return _replierUserId;
201: }
202:
203: public void setReplierUserId(long replierUserId) {
204: if (replierUserId != _replierUserId) {
205: _replierUserId = replierUserId;
206: }
207: }
208:
209: public int getStatusId() {
210: return _statusId;
211: }
212:
213: public void setStatusId(int statusId) {
214: if (statusId != _statusId) {
215: _statusId = statusId;
216: }
217: }
218:
219: public MembershipRequest toEscapedModel() {
220: if (isEscapedModel()) {
221: return (MembershipRequest) this ;
222: } else {
223: MembershipRequest model = new MembershipRequestImpl();
224:
225: model.setEscapedModel(true);
226:
227: model.setMembershipRequestId(getMembershipRequestId());
228: model.setCompanyId(getCompanyId());
229: model.setUserId(getUserId());
230: model.setCreateDate(getCreateDate());
231: model.setGroupId(getGroupId());
232: model.setComments(Html.escape(getComments()));
233: model.setReplyComments(Html.escape(getReplyComments()));
234: model.setReplyDate(getReplyDate());
235: model.setReplierUserId(getReplierUserId());
236: model.setStatusId(getStatusId());
237:
238: model = (MembershipRequest) Proxy.newProxyInstance(
239: MembershipRequest.class.getClassLoader(),
240: new Class[] { MembershipRequest.class },
241: new ReadOnlyBeanHandler(model));
242:
243: return model;
244: }
245: }
246:
247: public Object clone() {
248: MembershipRequestImpl clone = new MembershipRequestImpl();
249:
250: clone.setMembershipRequestId(getMembershipRequestId());
251: clone.setCompanyId(getCompanyId());
252: clone.setUserId(getUserId());
253: clone.setCreateDate(getCreateDate());
254: clone.setGroupId(getGroupId());
255: clone.setComments(getComments());
256: clone.setReplyComments(getReplyComments());
257: clone.setReplyDate(getReplyDate());
258: clone.setReplierUserId(getReplierUserId());
259: clone.setStatusId(getStatusId());
260:
261: return clone;
262: }
263:
264: public int compareTo(Object obj) {
265: if (obj == null) {
266: return -1;
267: }
268:
269: MembershipRequestImpl membershipRequest = (MembershipRequestImpl) obj;
270:
271: int value = 0;
272:
273: value = DateUtil.compareTo(getCreateDate(), membershipRequest
274: .getCreateDate());
275:
276: value = value * -1;
277:
278: if (value != 0) {
279: return value;
280: }
281:
282: return 0;
283: }
284:
285: public boolean equals(Object obj) {
286: if (obj == null) {
287: return false;
288: }
289:
290: MembershipRequestImpl membershipRequest = null;
291:
292: try {
293: membershipRequest = (MembershipRequestImpl) obj;
294: } catch (ClassCastException cce) {
295: return false;
296: }
297:
298: long pk = membershipRequest.getPrimaryKey();
299:
300: if (getPrimaryKey() == pk) {
301: return true;
302: } else {
303: return false;
304: }
305: }
306:
307: public int hashCode() {
308: return (int) getPrimaryKey();
309: }
310:
311: private long _membershipRequestId;
312: private long _companyId;
313: private long _userId;
314: private Date _createDate;
315: private long _groupId;
316: private String _comments;
317: private String _replyComments;
318: private Date _replyDate;
319: private long _replierUserId;
320: private int _statusId;
321: }
|