001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.util.GetterUtil;
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.kernel.util.StringPool;
021    import com.liferay.portal.model.Release;
022    import com.liferay.portal.model.ReleaseModel;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import com.liferay.portlet.expando.model.ExpandoBridge;
026    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
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     * The base model implementation for the Release service. Represents a row in the "Release_" database table, with each column mapped to a property of this class.
038     *
039     * <p>
040     * This implementation and its corresponding interface {@link com.liferay.portal.model.ReleaseModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link ReleaseImpl}.
041     * </p>
042     *
043     * <p>
044     * Never modify or reference this class directly. All methods that expect a release model instance should use the {@link com.liferay.portal.model.Release} interface instead.
045     * </p>
046     *
047     * @author Brian Wing Shun Chan
048     * @see ReleaseImpl
049     * @see com.liferay.portal.model.Release
050     * @see com.liferay.portal.model.ReleaseModel
051     * @generated
052     */
053    public class ReleaseModelImpl extends BaseModelImpl<Release>
054            implements ReleaseModel {
055            public static final String TABLE_NAME = "Release_";
056            public static final Object[][] TABLE_COLUMNS = {
057                            { "releaseId", new Integer(Types.BIGINT) },
058                            { "createDate", new Integer(Types.TIMESTAMP) },
059                            { "modifiedDate", new Integer(Types.TIMESTAMP) },
060                            { "servletContextName", new Integer(Types.VARCHAR) },
061                            { "buildNumber", new Integer(Types.INTEGER) },
062                            { "buildDate", new Integer(Types.TIMESTAMP) },
063                            { "verified", new Integer(Types.BOOLEAN) },
064                            { "testString", new Integer(Types.VARCHAR) }
065                    };
066            public static final String TABLE_SQL_CREATE = "create table Release_ (releaseId LONG not null primary key,createDate DATE null,modifiedDate DATE null,servletContextName VARCHAR(75) null,buildNumber INTEGER,buildDate DATE null,verified BOOLEAN,testString VARCHAR(1024) null)";
067            public static final String TABLE_SQL_DROP = "drop table Release_";
068            public static final String DATA_SOURCE = "liferayDataSource";
069            public static final String SESSION_FACTORY = "liferaySessionFactory";
070            public static final String TX_MANAGER = "liferayTransactionManager";
071            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
072                                    "value.object.entity.cache.enabled.com.liferay.portal.model.Release"),
073                            true);
074            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
075                                    "value.object.finder.cache.enabled.com.liferay.portal.model.Release"),
076                            true);
077            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
078                                    "lock.expiration.time.com.liferay.portal.model.Release"));
079    
080            public ReleaseModelImpl() {
081            }
082    
083            public long getPrimaryKey() {
084                    return _releaseId;
085            }
086    
087            public void setPrimaryKey(long pk) {
088                    setReleaseId(pk);
089            }
090    
091            public Serializable getPrimaryKeyObj() {
092                    return new Long(_releaseId);
093            }
094    
095            public long getReleaseId() {
096                    return _releaseId;
097            }
098    
099            public void setReleaseId(long releaseId) {
100                    _releaseId = releaseId;
101            }
102    
103            public Date getCreateDate() {
104                    return _createDate;
105            }
106    
107            public void setCreateDate(Date createDate) {
108                    _createDate = createDate;
109            }
110    
111            public Date getModifiedDate() {
112                    return _modifiedDate;
113            }
114    
115            public void setModifiedDate(Date modifiedDate) {
116                    _modifiedDate = modifiedDate;
117            }
118    
119            public String getServletContextName() {
120                    if (_servletContextName == null) {
121                            return StringPool.BLANK;
122                    }
123                    else {
124                            return _servletContextName;
125                    }
126            }
127    
128            public void setServletContextName(String servletContextName) {
129                    _servletContextName = servletContextName;
130    
131                    if (_originalServletContextName == null) {
132                            _originalServletContextName = servletContextName;
133                    }
134            }
135    
136            public String getOriginalServletContextName() {
137                    return GetterUtil.getString(_originalServletContextName);
138            }
139    
140            public int getBuildNumber() {
141                    return _buildNumber;
142            }
143    
144            public void setBuildNumber(int buildNumber) {
145                    _buildNumber = buildNumber;
146            }
147    
148            public Date getBuildDate() {
149                    return _buildDate;
150            }
151    
152            public void setBuildDate(Date buildDate) {
153                    _buildDate = buildDate;
154            }
155    
156            public boolean getVerified() {
157                    return _verified;
158            }
159    
160            public boolean isVerified() {
161                    return _verified;
162            }
163    
164            public void setVerified(boolean verified) {
165                    _verified = verified;
166            }
167    
168            public String getTestString() {
169                    if (_testString == null) {
170                            return StringPool.BLANK;
171                    }
172                    else {
173                            return _testString;
174                    }
175            }
176    
177            public void setTestString(String testString) {
178                    _testString = testString;
179            }
180    
181            public Release toEscapedModel() {
182                    if (isEscapedModel()) {
183                            return (Release)this;
184                    }
185                    else {
186                            return (Release)Proxy.newProxyInstance(Release.class.getClassLoader(),
187                                    new Class[] { Release.class }, new AutoEscapeBeanHandler(this));
188                    }
189            }
190    
191            public ExpandoBridge getExpandoBridge() {
192                    if (_expandoBridge == null) {
193                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(0,
194                                            Release.class.getName(), getPrimaryKey());
195                    }
196    
197                    return _expandoBridge;
198            }
199    
200            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
201                    getExpandoBridge().setAttributes(serviceContext);
202            }
203    
204            public Object clone() {
205                    ReleaseImpl clone = new ReleaseImpl();
206    
207                    clone.setReleaseId(getReleaseId());
208                    clone.setCreateDate(getCreateDate());
209                    clone.setModifiedDate(getModifiedDate());
210                    clone.setServletContextName(getServletContextName());
211                    clone.setBuildNumber(getBuildNumber());
212                    clone.setBuildDate(getBuildDate());
213                    clone.setVerified(getVerified());
214                    clone.setTestString(getTestString());
215    
216                    return clone;
217            }
218    
219            public int compareTo(Release release) {
220                    long pk = release.getPrimaryKey();
221    
222                    if (getPrimaryKey() < pk) {
223                            return -1;
224                    }
225                    else if (getPrimaryKey() > pk) {
226                            return 1;
227                    }
228                    else {
229                            return 0;
230                    }
231            }
232    
233            public boolean equals(Object obj) {
234                    if (obj == null) {
235                            return false;
236                    }
237    
238                    Release release = null;
239    
240                    try {
241                            release = (Release)obj;
242                    }
243                    catch (ClassCastException cce) {
244                            return false;
245                    }
246    
247                    long pk = release.getPrimaryKey();
248    
249                    if (getPrimaryKey() == pk) {
250                            return true;
251                    }
252                    else {
253                            return false;
254                    }
255            }
256    
257            public int hashCode() {
258                    return (int)getPrimaryKey();
259            }
260    
261            public String toString() {
262                    StringBundler sb = new StringBundler(17);
263    
264                    sb.append("{releaseId=");
265                    sb.append(getReleaseId());
266                    sb.append(", createDate=");
267                    sb.append(getCreateDate());
268                    sb.append(", modifiedDate=");
269                    sb.append(getModifiedDate());
270                    sb.append(", servletContextName=");
271                    sb.append(getServletContextName());
272                    sb.append(", buildNumber=");
273                    sb.append(getBuildNumber());
274                    sb.append(", buildDate=");
275                    sb.append(getBuildDate());
276                    sb.append(", verified=");
277                    sb.append(getVerified());
278                    sb.append(", testString=");
279                    sb.append(getTestString());
280                    sb.append("}");
281    
282                    return sb.toString();
283            }
284    
285            public String toXmlString() {
286                    StringBundler sb = new StringBundler(28);
287    
288                    sb.append("<model><model-name>");
289                    sb.append("com.liferay.portal.model.Release");
290                    sb.append("</model-name>");
291    
292                    sb.append(
293                            "<column><column-name>releaseId</column-name><column-value><![CDATA[");
294                    sb.append(getReleaseId());
295                    sb.append("]]></column-value></column>");
296                    sb.append(
297                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
298                    sb.append(getCreateDate());
299                    sb.append("]]></column-value></column>");
300                    sb.append(
301                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
302                    sb.append(getModifiedDate());
303                    sb.append("]]></column-value></column>");
304                    sb.append(
305                            "<column><column-name>servletContextName</column-name><column-value><![CDATA[");
306                    sb.append(getServletContextName());
307                    sb.append("]]></column-value></column>");
308                    sb.append(
309                            "<column><column-name>buildNumber</column-name><column-value><![CDATA[");
310                    sb.append(getBuildNumber());
311                    sb.append("]]></column-value></column>");
312                    sb.append(
313                            "<column><column-name>buildDate</column-name><column-value><![CDATA[");
314                    sb.append(getBuildDate());
315                    sb.append("]]></column-value></column>");
316                    sb.append(
317                            "<column><column-name>verified</column-name><column-value><![CDATA[");
318                    sb.append(getVerified());
319                    sb.append("]]></column-value></column>");
320                    sb.append(
321                            "<column><column-name>testString</column-name><column-value><![CDATA[");
322                    sb.append(getTestString());
323                    sb.append("]]></column-value></column>");
324    
325                    sb.append("</model>");
326    
327                    return sb.toString();
328            }
329    
330            private long _releaseId;
331            private Date _createDate;
332            private Date _modifiedDate;
333            private String _servletContextName;
334            private String _originalServletContextName;
335            private int _buildNumber;
336            private Date _buildDate;
337            private boolean _verified;
338            private String _testString;
339            private transient ExpandoBridge _expandoBridge;
340    }