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.kernel.util.HtmlUtil;
28 import com.liferay.portal.kernel.util.StringPool;
29 import com.liferay.portal.model.WebDAVProps;
30 import com.liferay.portal.model.WebDAVPropsSoap;
31 import com.liferay.portal.util.PortalUtil;
32
33 import java.io.Serializable;
34
35 import java.lang.reflect.Proxy;
36
37 import java.sql.Types;
38
39 import java.util.ArrayList;
40 import java.util.Date;
41 import java.util.List;
42
43
63 public class WebDAVPropsModelImpl extends BaseModelImpl {
64 public static final String TABLE_NAME = "WebDAVProps";
65 public static final Object[][] TABLE_COLUMNS = {
66 { "webDavPropsId", new Integer(Types.BIGINT) },
67
68
69 { "companyId", new Integer(Types.BIGINT) },
70
71
72 { "createDate", new Integer(Types.TIMESTAMP) },
73
74
75 { "modifiedDate", new Integer(Types.TIMESTAMP) },
76
77
78 { "classNameId", new Integer(Types.BIGINT) },
79
80
81 { "classPK", new Integer(Types.BIGINT) },
82
83
84 { "props", new Integer(Types.CLOB) }
85 };
86 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)";
87 public static final String TABLE_SQL_DROP = "drop table WebDAVProps";
88 public static final String DATA_SOURCE = "liferayDataSource";
89 public static final String SESSION_FACTORY = "liferaySessionFactory";
90 public static final String TX_MANAGER = "liferayTransactionManager";
91 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
92 "value.object.finder.cache.enabled.com.liferay.portal.model.WebDAVProps"),
93 true);
94
95 public static WebDAVProps toModel(WebDAVPropsSoap soapModel) {
96 WebDAVProps model = new WebDAVPropsImpl();
97
98 model.setWebDavPropsId(soapModel.getWebDavPropsId());
99 model.setCompanyId(soapModel.getCompanyId());
100 model.setCreateDate(soapModel.getCreateDate());
101 model.setModifiedDate(soapModel.getModifiedDate());
102 model.setClassNameId(soapModel.getClassNameId());
103 model.setClassPK(soapModel.getClassPK());
104 model.setProps(soapModel.getProps());
105
106 return model;
107 }
108
109 public static List<WebDAVProps> toModels(WebDAVPropsSoap[] soapModels) {
110 List<WebDAVProps> models = new ArrayList<WebDAVProps>(soapModels.length);
111
112 for (WebDAVPropsSoap soapModel : soapModels) {
113 models.add(toModel(soapModel));
114 }
115
116 return models;
117 }
118
119 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
120 "lock.expiration.time.com.liferay.portal.model.WebDAVProps"));
121
122 public WebDAVPropsModelImpl() {
123 }
124
125 public long getPrimaryKey() {
126 return _webDavPropsId;
127 }
128
129 public void setPrimaryKey(long pk) {
130 setWebDavPropsId(pk);
131 }
132
133 public Serializable getPrimaryKeyObj() {
134 return new Long(_webDavPropsId);
135 }
136
137 public long getWebDavPropsId() {
138 return _webDavPropsId;
139 }
140
141 public void setWebDavPropsId(long webDavPropsId) {
142 if (webDavPropsId != _webDavPropsId) {
143 _webDavPropsId = webDavPropsId;
144 }
145 }
146
147 public long getCompanyId() {
148 return _companyId;
149 }
150
151 public void setCompanyId(long companyId) {
152 if (companyId != _companyId) {
153 _companyId = companyId;
154 }
155 }
156
157 public Date getCreateDate() {
158 return _createDate;
159 }
160
161 public void setCreateDate(Date createDate) {
162 if (((createDate == null) && (_createDate != null)) ||
163 ((createDate != null) && (_createDate == null)) ||
164 ((createDate != null) && (_createDate != null) &&
165 !createDate.equals(_createDate))) {
166 _createDate = createDate;
167 }
168 }
169
170 public Date getModifiedDate() {
171 return _modifiedDate;
172 }
173
174 public void setModifiedDate(Date modifiedDate) {
175 if (((modifiedDate == null) && (_modifiedDate != null)) ||
176 ((modifiedDate != null) && (_modifiedDate == null)) ||
177 ((modifiedDate != null) && (_modifiedDate != null) &&
178 !modifiedDate.equals(_modifiedDate))) {
179 _modifiedDate = modifiedDate;
180 }
181 }
182
183 public String getClassName() {
184 if (getClassNameId() <= 0) {
185 return StringPool.BLANK;
186 }
187
188 return PortalUtil.getClassName(getClassNameId());
189 }
190
191 public long getClassNameId() {
192 return _classNameId;
193 }
194
195 public void setClassNameId(long classNameId) {
196 if (classNameId != _classNameId) {
197 _classNameId = classNameId;
198 }
199 }
200
201 public long getClassPK() {
202 return _classPK;
203 }
204
205 public void setClassPK(long classPK) {
206 if (classPK != _classPK) {
207 _classPK = classPK;
208 }
209 }
210
211 public String getProps() {
212 return GetterUtil.getString(_props);
213 }
214
215 public void setProps(String props) {
216 if (((props == null) && (_props != null)) ||
217 ((props != null) && (_props == null)) ||
218 ((props != null) && (_props != null) && !props.equals(_props))) {
219 _props = props;
220 }
221 }
222
223 public WebDAVProps toEscapedModel() {
224 if (isEscapedModel()) {
225 return (WebDAVProps)this;
226 }
227 else {
228 WebDAVProps model = new WebDAVPropsImpl();
229
230 model.setNew(isNew());
231 model.setEscapedModel(true);
232
233 model.setWebDavPropsId(getWebDavPropsId());
234 model.setCompanyId(getCompanyId());
235 model.setCreateDate(getCreateDate());
236 model.setModifiedDate(getModifiedDate());
237 model.setClassNameId(getClassNameId());
238 model.setClassPK(getClassPK());
239 model.setProps(HtmlUtil.escape(getProps()));
240
241 model = (WebDAVProps)Proxy.newProxyInstance(WebDAVProps.class.getClassLoader(),
242 new Class[] { WebDAVProps.class },
243 new ReadOnlyBeanHandler(model));
244
245 return model;
246 }
247 }
248
249 public Object clone() {
250 WebDAVPropsImpl clone = new WebDAVPropsImpl();
251
252 clone.setWebDavPropsId(getWebDavPropsId());
253 clone.setCompanyId(getCompanyId());
254 clone.setCreateDate(getCreateDate());
255 clone.setModifiedDate(getModifiedDate());
256 clone.setClassNameId(getClassNameId());
257 clone.setClassPK(getClassPK());
258 clone.setProps(getProps());
259
260 return clone;
261 }
262
263 public int compareTo(Object obj) {
264 if (obj == null) {
265 return -1;
266 }
267
268 WebDAVPropsImpl webDAVProps = (WebDAVPropsImpl)obj;
269
270 long pk = webDAVProps.getPrimaryKey();
271
272 if (getPrimaryKey() < pk) {
273 return -1;
274 }
275 else if (getPrimaryKey() > pk) {
276 return 1;
277 }
278 else {
279 return 0;
280 }
281 }
282
283 public boolean equals(Object obj) {
284 if (obj == null) {
285 return false;
286 }
287
288 WebDAVPropsImpl webDAVProps = null;
289
290 try {
291 webDAVProps = (WebDAVPropsImpl)obj;
292 }
293 catch (ClassCastException cce) {
294 return false;
295 }
296
297 long pk = webDAVProps.getPrimaryKey();
298
299 if (getPrimaryKey() == pk) {
300 return true;
301 }
302 else {
303 return false;
304 }
305 }
306
307 public int hashCode() {
308 return (int)getPrimaryKey();
309 }
310
311 private long _webDavPropsId;
312 private long _companyId;
313 private Date _createDate;
314 private Date _modifiedDate;
315 private long _classNameId;
316 private long _classPK;
317 private String _props;
318 }