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.GetterUtil;
025: import com.liferay.portal.model.Release;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import java.io.Serializable;
029:
030: import java.lang.reflect.Proxy;
031:
032: import java.sql.Types;
033:
034: import java.util.Date;
035:
036: /**
037: * <a href="ReleaseModelImpl.java.html"><b><i>View Source</i></b></a>
038: *
039: * <p>
040: * ServiceBuilder generated this class. Modifications in this class will be
041: * overwritten the next time is generated.
042: * </p>
043: *
044: * <p>
045: * This class is a model that represents the <code>Release</code> table
046: * in the database.
047: * </p>
048: *
049: * @author Brian Wing Shun Chan
050: *
051: * @see com.liferay.portal.service.model.Release
052: * @see com.liferay.portal.service.model.ReleaseModel
053: * @see com.liferay.portal.service.model.impl.ReleaseImpl
054: *
055: */
056: public class ReleaseModelImpl extends BaseModelImpl {
057: public static final String TABLE_NAME = "Release_";
058: public static final Object[][] TABLE_COLUMNS = {
059: { "releaseId", new Integer(Types.BIGINT) },
060:
061: { "createDate", new Integer(Types.TIMESTAMP) },
062:
063: { "modifiedDate", new Integer(Types.TIMESTAMP) },
064:
065: { "buildNumber", new Integer(Types.INTEGER) },
066:
067: { "buildDate", new Integer(Types.TIMESTAMP) },
068:
069: { "verified", new Integer(Types.BOOLEAN) } };
070: public static final String TABLE_SQL_CREATE = "create table Release_ (releaseId LONG not null primary key,createDate DATE null,modifiedDate DATE null,buildNumber INTEGER,buildDate DATE null,verified BOOLEAN)";
071: public static final String TABLE_SQL_DROP = "drop table Release_";
072: public static final boolean CACHE_ENABLED = GetterUtil
073: .getBoolean(
074: PropsUtil
075: .get("value.object.finder.cache.enabled.com.liferay.portal.model.Release"),
076: true);
077: public static final long LOCK_EXPIRATION_TIME = GetterUtil
078: .getLong(PropsUtil
079: .get("lock.expiration.time.com.liferay.portal.model.Release"));
080:
081: public ReleaseModelImpl() {
082: }
083:
084: public long getPrimaryKey() {
085: return _releaseId;
086: }
087:
088: public void setPrimaryKey(long pk) {
089: setReleaseId(pk);
090: }
091:
092: public Serializable getPrimaryKeyObj() {
093: return new Long(_releaseId);
094: }
095:
096: public long getReleaseId() {
097: return _releaseId;
098: }
099:
100: public void setReleaseId(long releaseId) {
101: if (releaseId != _releaseId) {
102: _releaseId = releaseId;
103: }
104: }
105:
106: public Date getCreateDate() {
107: return _createDate;
108: }
109:
110: public void setCreateDate(Date createDate) {
111: if (((createDate == null) && (_createDate != null))
112: || ((createDate != null) && (_createDate == null))
113: || ((createDate != null) && (_createDate != null) && !createDate
114: .equals(_createDate))) {
115: _createDate = createDate;
116: }
117: }
118:
119: public Date getModifiedDate() {
120: return _modifiedDate;
121: }
122:
123: public void setModifiedDate(Date modifiedDate) {
124: if (((modifiedDate == null) && (_modifiedDate != null))
125: || ((modifiedDate != null) && (_modifiedDate == null))
126: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
127: .equals(_modifiedDate))) {
128: _modifiedDate = modifiedDate;
129: }
130: }
131:
132: public int getBuildNumber() {
133: return _buildNumber;
134: }
135:
136: public void setBuildNumber(int buildNumber) {
137: if (buildNumber != _buildNumber) {
138: _buildNumber = buildNumber;
139: }
140: }
141:
142: public Date getBuildDate() {
143: return _buildDate;
144: }
145:
146: public void setBuildDate(Date buildDate) {
147: if (((buildDate == null) && (_buildDate != null))
148: || ((buildDate != null) && (_buildDate == null))
149: || ((buildDate != null) && (_buildDate != null) && !buildDate
150: .equals(_buildDate))) {
151: _buildDate = buildDate;
152: }
153: }
154:
155: public boolean getVerified() {
156: return _verified;
157: }
158:
159: public boolean isVerified() {
160: return _verified;
161: }
162:
163: public void setVerified(boolean verified) {
164: if (verified != _verified) {
165: _verified = verified;
166: }
167: }
168:
169: public Release toEscapedModel() {
170: if (isEscapedModel()) {
171: return (Release) this ;
172: } else {
173: Release model = new ReleaseImpl();
174:
175: model.setEscapedModel(true);
176:
177: model.setReleaseId(getReleaseId());
178: model.setCreateDate(getCreateDate());
179: model.setModifiedDate(getModifiedDate());
180: model.setBuildNumber(getBuildNumber());
181: model.setBuildDate(getBuildDate());
182: model.setVerified(getVerified());
183:
184: model = (Release) Proxy.newProxyInstance(Release.class
185: .getClassLoader(), new Class[] { Release.class },
186: new ReadOnlyBeanHandler(model));
187:
188: return model;
189: }
190: }
191:
192: public Object clone() {
193: ReleaseImpl clone = new ReleaseImpl();
194:
195: clone.setReleaseId(getReleaseId());
196: clone.setCreateDate(getCreateDate());
197: clone.setModifiedDate(getModifiedDate());
198: clone.setBuildNumber(getBuildNumber());
199: clone.setBuildDate(getBuildDate());
200: clone.setVerified(getVerified());
201:
202: return clone;
203: }
204:
205: public int compareTo(Object obj) {
206: if (obj == null) {
207: return -1;
208: }
209:
210: ReleaseImpl release = (ReleaseImpl) obj;
211:
212: long pk = release.getPrimaryKey();
213:
214: if (getPrimaryKey() < pk) {
215: return -1;
216: } else if (getPrimaryKey() > pk) {
217: return 1;
218: } else {
219: return 0;
220: }
221: }
222:
223: public boolean equals(Object obj) {
224: if (obj == null) {
225: return false;
226: }
227:
228: ReleaseImpl release = null;
229:
230: try {
231: release = (ReleaseImpl) obj;
232: } catch (ClassCastException cce) {
233: return false;
234: }
235:
236: long pk = release.getPrimaryKey();
237:
238: if (getPrimaryKey() == pk) {
239: return true;
240: } else {
241: return false;
242: }
243: }
244:
245: public int hashCode() {
246: return (int) getPrimaryKey();
247: }
248:
249: private long _releaseId;
250: private Date _createDate;
251: private Date _modifiedDate;
252: private int _buildNumber;
253: private Date _buildDate;
254: private boolean _verified;
255: }
|