1
22
23 package com.liferay.portal.model.impl;
24
25 import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26 import com.liferay.portal.kernel.util.GetterUtil;
27 import com.liferay.portal.model.Release;
28 import com.liferay.portal.model.ReleaseSoap;
29 import com.liferay.portal.util.PropsUtil;
30
31 import java.io.Serializable;
32
33 import java.lang.reflect.Proxy;
34
35 import java.sql.Types;
36
37 import java.util.ArrayList;
38 import java.util.Date;
39 import java.util.List;
40
41
61 public class ReleaseModelImpl extends BaseModelImpl {
62 public static final String TABLE_NAME = "Release_";
63 public static final Object[][] TABLE_COLUMNS = {
64 { "releaseId", new Integer(Types.BIGINT) },
65
66
67 { "createDate", new Integer(Types.TIMESTAMP) },
68
69
70 { "modifiedDate", new Integer(Types.TIMESTAMP) },
71
72
73 { "buildNumber", new Integer(Types.INTEGER) },
74
75
76 { "buildDate", new Integer(Types.TIMESTAMP) },
77
78
79 { "verified", new Integer(Types.BOOLEAN) }
80 };
81 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)";
82 public static final String TABLE_SQL_DROP = "drop table Release_";
83 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(PropsUtil.get(
84 "value.object.finder.cache.enabled.com.liferay.portal.model.Release"),
85 true);
86
87 public static Release toModel(ReleaseSoap soapModel) {
88 Release model = new ReleaseImpl();
89
90 model.setReleaseId(soapModel.getReleaseId());
91 model.setCreateDate(soapModel.getCreateDate());
92 model.setModifiedDate(soapModel.getModifiedDate());
93 model.setBuildNumber(soapModel.getBuildNumber());
94 model.setBuildDate(soapModel.getBuildDate());
95 model.setVerified(soapModel.getVerified());
96
97 return model;
98 }
99
100 public static List<Release> toModels(ReleaseSoap[] soapModels) {
101 List<Release> models = new ArrayList<Release>(soapModels.length);
102
103 for (ReleaseSoap soapModel : soapModels) {
104 models.add(toModel(soapModel));
105 }
106
107 return models;
108 }
109
110 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
111 "lock.expiration.time.com.liferay.portal.model.Release"));
112
113 public ReleaseModelImpl() {
114 }
115
116 public long getPrimaryKey() {
117 return _releaseId;
118 }
119
120 public void setPrimaryKey(long pk) {
121 setReleaseId(pk);
122 }
123
124 public Serializable getPrimaryKeyObj() {
125 return new Long(_releaseId);
126 }
127
128 public long getReleaseId() {
129 return _releaseId;
130 }
131
132 public void setReleaseId(long releaseId) {
133 if (releaseId != _releaseId) {
134 _releaseId = releaseId;
135 }
136 }
137
138 public Date getCreateDate() {
139 return _createDate;
140 }
141
142 public void setCreateDate(Date createDate) {
143 if (((createDate == null) && (_createDate != null)) ||
144 ((createDate != null) && (_createDate == null)) ||
145 ((createDate != null) && (_createDate != null) &&
146 !createDate.equals(_createDate))) {
147 _createDate = createDate;
148 }
149 }
150
151 public Date getModifiedDate() {
152 return _modifiedDate;
153 }
154
155 public void setModifiedDate(Date modifiedDate) {
156 if (((modifiedDate == null) && (_modifiedDate != null)) ||
157 ((modifiedDate != null) && (_modifiedDate == null)) ||
158 ((modifiedDate != null) && (_modifiedDate != null) &&
159 !modifiedDate.equals(_modifiedDate))) {
160 _modifiedDate = modifiedDate;
161 }
162 }
163
164 public int getBuildNumber() {
165 return _buildNumber;
166 }
167
168 public void setBuildNumber(int buildNumber) {
169 if (buildNumber != _buildNumber) {
170 _buildNumber = buildNumber;
171 }
172 }
173
174 public Date getBuildDate() {
175 return _buildDate;
176 }
177
178 public void setBuildDate(Date buildDate) {
179 if (((buildDate == null) && (_buildDate != null)) ||
180 ((buildDate != null) && (_buildDate == null)) ||
181 ((buildDate != null) && (_buildDate != null) &&
182 !buildDate.equals(_buildDate))) {
183 _buildDate = buildDate;
184 }
185 }
186
187 public boolean getVerified() {
188 return _verified;
189 }
190
191 public boolean isVerified() {
192 return _verified;
193 }
194
195 public void setVerified(boolean verified) {
196 if (verified != _verified) {
197 _verified = verified;
198 }
199 }
200
201 public Release toEscapedModel() {
202 if (isEscapedModel()) {
203 return (Release)this;
204 }
205 else {
206 Release model = new ReleaseImpl();
207
208 model.setEscapedModel(true);
209
210 model.setReleaseId(getReleaseId());
211 model.setCreateDate(getCreateDate());
212 model.setModifiedDate(getModifiedDate());
213 model.setBuildNumber(getBuildNumber());
214 model.setBuildDate(getBuildDate());
215 model.setVerified(getVerified());
216
217 model = (Release)Proxy.newProxyInstance(Release.class.getClassLoader(),
218 new Class[] { Release.class },
219 new ReadOnlyBeanHandler(model));
220
221 return model;
222 }
223 }
224
225 public Object clone() {
226 ReleaseImpl clone = new ReleaseImpl();
227
228 clone.setReleaseId(getReleaseId());
229 clone.setCreateDate(getCreateDate());
230 clone.setModifiedDate(getModifiedDate());
231 clone.setBuildNumber(getBuildNumber());
232 clone.setBuildDate(getBuildDate());
233 clone.setVerified(getVerified());
234
235 return clone;
236 }
237
238 public int compareTo(Object obj) {
239 if (obj == null) {
240 return -1;
241 }
242
243 ReleaseImpl release = (ReleaseImpl)obj;
244
245 long pk = release.getPrimaryKey();
246
247 if (getPrimaryKey() < pk) {
248 return -1;
249 }
250 else if (getPrimaryKey() > pk) {
251 return 1;
252 }
253 else {
254 return 0;
255 }
256 }
257
258 public boolean equals(Object obj) {
259 if (obj == null) {
260 return false;
261 }
262
263 ReleaseImpl release = null;
264
265 try {
266 release = (ReleaseImpl)obj;
267 }
268 catch (ClassCastException cce) {
269 return false;
270 }
271
272 long pk = release.getPrimaryKey();
273
274 if (getPrimaryKey() == pk) {
275 return true;
276 }
277 else {
278 return false;
279 }
280 }
281
282 public int hashCode() {
283 return (int)getPrimaryKey();
284 }
285
286 private long _releaseId;
287 private Date _createDate;
288 private Date _modifiedDate;
289 private int _buildNumber;
290 private Date _buildDate;
291 private boolean _verified;
292 }