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