PageRenderTime 41ms CodeModel.GetById 20ms app.highlight 18ms RepoModel.GetById 0ms app.codeStats 0ms

/portlets/hr-portlet/docroot/WEB-INF/src/com/liferay/hr/model/impl/HRUserProjectModelImpl.java

https://github.com/stevenjiancao/liferay-plugins
Java | 501 lines | 380 code | 90 blank | 31 comment | 28 complexity | 5a552368394cb69aed3cd134eccbf577 MD5 | raw file
  1/**
  2 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
  3 *
  4 * This library is free software; you can redistribute it and/or modify it under
  5 * the terms of the GNU Lesser General Public License as published by the Free
  6 * Software Foundation; either version 2.1 of the License, or (at your option)
  7 * any later version.
  8 *
  9 * This library is distributed in the hope that it will be useful, but WITHOUT
 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 12 * details.
 13 */
 14
 15package com.liferay.hr.model.impl;
 16
 17import com.liferay.hr.model.HRUserProject;
 18import com.liferay.hr.model.HRUserProjectModel;
 19
 20import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
 21import com.liferay.portal.kernel.exception.SystemException;
 22import com.liferay.portal.kernel.util.GetterUtil;
 23import com.liferay.portal.kernel.util.StringBundler;
 24import com.liferay.portal.kernel.util.StringPool;
 25import com.liferay.portal.model.CacheModel;
 26import com.liferay.portal.model.impl.BaseModelImpl;
 27import com.liferay.portal.service.ServiceContext;
 28import com.liferay.portal.util.PortalUtil;
 29
 30import com.liferay.portlet.expando.model.ExpandoBridge;
 31import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
 32
 33import java.io.Serializable;
 34
 35import java.lang.reflect.Proxy;
 36
 37import java.sql.Types;
 38
 39import java.util.Date;
 40
 41/**
 42 * The base model implementation for the HRUserProject service. Represents a row in the "HRUserProject" database table, with each column mapped to a property of this class.
 43 *
 44 * <p>
 45 * This implementation and its corresponding interface {@link com.liferay.hr.model.HRUserProjectModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link HRUserProjectImpl}.
 46 * </p>
 47 *
 48 * @author Wesley Gong
 49 * @see HRUserProjectImpl
 50 * @see com.liferay.hr.model.HRUserProject
 51 * @see com.liferay.hr.model.HRUserProjectModel
 52 * @generated
 53 */
 54public class HRUserProjectModelImpl extends BaseModelImpl<HRUserProject>
 55	implements HRUserProjectModel {
 56	/*
 57	 * NOTE FOR DEVELOPERS:
 58	 *
 59	 * Never modify or reference this class directly. All methods that expect a h r user project model instance should use the {@link com.liferay.hr.model.HRUserProject} interface instead.
 60	 */
 61	public static final String TABLE_NAME = "HRUserProject";
 62	public static final Object[][] TABLE_COLUMNS = {
 63			{ "hrUserProjectId", Types.BIGINT },
 64			{ "groupId", Types.BIGINT },
 65			{ "companyId", Types.BIGINT },
 66			{ "userId", Types.BIGINT },
 67			{ "userName", Types.VARCHAR },
 68			{ "createDate", Types.TIMESTAMP },
 69			{ "modifiedDate", Types.TIMESTAMP },
 70			{ "hrProjectBillingRateId", Types.BIGINT },
 71			{ "hrProjectId", Types.BIGINT },
 72			{ "hrProjectRoleId", Types.BIGINT },
 73			{ "hrUserId", Types.BIGINT },
 74			{ "actualRate", Types.DOUBLE }
 75		};
 76	public static final String TABLE_SQL_CREATE = "create table HRUserProject (hrUserProjectId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,hrProjectBillingRateId LONG,hrProjectId LONG,hrProjectRoleId LONG,hrUserId LONG,actualRate DOUBLE)";
 77	public static final String TABLE_SQL_DROP = "drop table HRUserProject";
 78	public static final String DATA_SOURCE = "liferayDataSource";
 79	public static final String SESSION_FACTORY = "liferaySessionFactory";
 80	public static final String TX_MANAGER = "liferayTransactionManager";
 81	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
 82				"value.object.entity.cache.enabled.com.liferay.hr.model.HRUserProject"),
 83			true);
 84	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
 85				"value.object.finder.cache.enabled.com.liferay.hr.model.HRUserProject"),
 86			true);
 87
 88	public Class<?> getModelClass() {
 89		return HRUserProject.class;
 90	}
 91
 92	public String getModelClassName() {
 93		return HRUserProject.class.getName();
 94	}
 95
 96	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
 97				"lock.expiration.time.com.liferay.hr.model.HRUserProject"));
 98
 99	public HRUserProjectModelImpl() {
100	}
101
102	public long getPrimaryKey() {
103		return _hrUserProjectId;
104	}
105
106	public void setPrimaryKey(long primaryKey) {
107		setHrUserProjectId(primaryKey);
108	}
109
110	public Serializable getPrimaryKeyObj() {
111		return new Long(_hrUserProjectId);
112	}
113
114	public void setPrimaryKeyObj(Serializable primaryKeyObj) {
115		setPrimaryKey(((Long)primaryKeyObj).longValue());
116	}
117
118	public long getHrUserProjectId() {
119		return _hrUserProjectId;
120	}
121
122	public void setHrUserProjectId(long hrUserProjectId) {
123		_hrUserProjectId = hrUserProjectId;
124	}
125
126	public long getGroupId() {
127		return _groupId;
128	}
129
130	public void setGroupId(long groupId) {
131		_groupId = groupId;
132	}
133
134	public long getCompanyId() {
135		return _companyId;
136	}
137
138	public void setCompanyId(long companyId) {
139		_companyId = companyId;
140	}
141
142	public long getUserId() {
143		return _userId;
144	}
145
146	public void setUserId(long userId) {
147		_userId = userId;
148	}
149
150	public String getUserUuid() throws SystemException {
151		return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
152	}
153
154	public void setUserUuid(String userUuid) {
155		_userUuid = userUuid;
156	}
157
158	public String getUserName() {
159		if (_userName == null) {
160			return StringPool.BLANK;
161		}
162		else {
163			return _userName;
164		}
165	}
166
167	public void setUserName(String userName) {
168		_userName = userName;
169	}
170
171	public Date getCreateDate() {
172		return _createDate;
173	}
174
175	public void setCreateDate(Date createDate) {
176		_createDate = createDate;
177	}
178
179	public Date getModifiedDate() {
180		return _modifiedDate;
181	}
182
183	public void setModifiedDate(Date modifiedDate) {
184		_modifiedDate = modifiedDate;
185	}
186
187	public long getHrProjectBillingRateId() {
188		return _hrProjectBillingRateId;
189	}
190
191	public void setHrProjectBillingRateId(long hrProjectBillingRateId) {
192		_hrProjectBillingRateId = hrProjectBillingRateId;
193	}
194
195	public long getHrProjectId() {
196		return _hrProjectId;
197	}
198
199	public void setHrProjectId(long hrProjectId) {
200		_hrProjectId = hrProjectId;
201	}
202
203	public long getHrProjectRoleId() {
204		return _hrProjectRoleId;
205	}
206
207	public void setHrProjectRoleId(long hrProjectRoleId) {
208		_hrProjectRoleId = hrProjectRoleId;
209	}
210
211	public long getHrUserId() {
212		return _hrUserId;
213	}
214
215	public void setHrUserId(long hrUserId) {
216		_hrUserId = hrUserId;
217	}
218
219	public String getHrUserUuid() throws SystemException {
220		return PortalUtil.getUserValue(getHrUserId(), "uuid", _hrUserUuid);
221	}
222
223	public void setHrUserUuid(String hrUserUuid) {
224		_hrUserUuid = hrUserUuid;
225	}
226
227	public double getActualRate() {
228		return _actualRate;
229	}
230
231	public void setActualRate(double actualRate) {
232		_actualRate = actualRate;
233	}
234
235	@Override
236	public HRUserProject toEscapedModel() {
237		if (isEscapedModel()) {
238			return (HRUserProject)this;
239		}
240		else {
241			if (_escapedModelProxy == null) {
242				_escapedModelProxy = (HRUserProject)Proxy.newProxyInstance(_classLoader,
243						_escapedModelProxyInterfaces,
244						new AutoEscapeBeanHandler(this));
245			}
246
247			return _escapedModelProxy;
248		}
249	}
250
251	@Override
252	public ExpandoBridge getExpandoBridge() {
253		if (_expandoBridge == null) {
254			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
255					HRUserProject.class.getName(), getPrimaryKey());
256		}
257
258		return _expandoBridge;
259	}
260
261	@Override
262	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
263		getExpandoBridge().setAttributes(serviceContext);
264	}
265
266	@Override
267	public Object clone() {
268		HRUserProjectImpl hrUserProjectImpl = new HRUserProjectImpl();
269
270		hrUserProjectImpl.setHrUserProjectId(getHrUserProjectId());
271		hrUserProjectImpl.setGroupId(getGroupId());
272		hrUserProjectImpl.setCompanyId(getCompanyId());
273		hrUserProjectImpl.setUserId(getUserId());
274		hrUserProjectImpl.setUserName(getUserName());
275		hrUserProjectImpl.setCreateDate(getCreateDate());
276		hrUserProjectImpl.setModifiedDate(getModifiedDate());
277		hrUserProjectImpl.setHrProjectBillingRateId(getHrProjectBillingRateId());
278		hrUserProjectImpl.setHrProjectId(getHrProjectId());
279		hrUserProjectImpl.setHrProjectRoleId(getHrProjectRoleId());
280		hrUserProjectImpl.setHrUserId(getHrUserId());
281		hrUserProjectImpl.setActualRate(getActualRate());
282
283		hrUserProjectImpl.resetOriginalValues();
284
285		return hrUserProjectImpl;
286	}
287
288	public int compareTo(HRUserProject hrUserProject) {
289		long primaryKey = hrUserProject.getPrimaryKey();
290
291		if (getPrimaryKey() < primaryKey) {
292			return -1;
293		}
294		else if (getPrimaryKey() > primaryKey) {
295			return 1;
296		}
297		else {
298			return 0;
299		}
300	}
301
302	@Override
303	public boolean equals(Object obj) {
304		if (obj == null) {
305			return false;
306		}
307
308		HRUserProject hrUserProject = null;
309
310		try {
311			hrUserProject = (HRUserProject)obj;
312		}
313		catch (ClassCastException cce) {
314			return false;
315		}
316
317		long primaryKey = hrUserProject.getPrimaryKey();
318
319		if (getPrimaryKey() == primaryKey) {
320			return true;
321		}
322		else {
323			return false;
324		}
325	}
326
327	@Override
328	public int hashCode() {
329		return (int)getPrimaryKey();
330	}
331
332	@Override
333	public void resetOriginalValues() {
334	}
335
336	@Override
337	public CacheModel<HRUserProject> toCacheModel() {
338		HRUserProjectCacheModel hrUserProjectCacheModel = new HRUserProjectCacheModel();
339
340		hrUserProjectCacheModel.hrUserProjectId = getHrUserProjectId();
341
342		hrUserProjectCacheModel.groupId = getGroupId();
343
344		hrUserProjectCacheModel.companyId = getCompanyId();
345
346		hrUserProjectCacheModel.userId = getUserId();
347
348		hrUserProjectCacheModel.userName = getUserName();
349
350		String userName = hrUserProjectCacheModel.userName;
351
352		if ((userName != null) && (userName.length() == 0)) {
353			hrUserProjectCacheModel.userName = null;
354		}
355
356		Date createDate = getCreateDate();
357
358		if (createDate != null) {
359			hrUserProjectCacheModel.createDate = createDate.getTime();
360		}
361		else {
362			hrUserProjectCacheModel.createDate = Long.MIN_VALUE;
363		}
364
365		Date modifiedDate = getModifiedDate();
366
367		if (modifiedDate != null) {
368			hrUserProjectCacheModel.modifiedDate = modifiedDate.getTime();
369		}
370		else {
371			hrUserProjectCacheModel.modifiedDate = Long.MIN_VALUE;
372		}
373
374		hrUserProjectCacheModel.hrProjectBillingRateId = getHrProjectBillingRateId();
375
376		hrUserProjectCacheModel.hrProjectId = getHrProjectId();
377
378		hrUserProjectCacheModel.hrProjectRoleId = getHrProjectRoleId();
379
380		hrUserProjectCacheModel.hrUserId = getHrUserId();
381
382		hrUserProjectCacheModel.actualRate = getActualRate();
383
384		return hrUserProjectCacheModel;
385	}
386
387	@Override
388	public String toString() {
389		StringBundler sb = new StringBundler(25);
390
391		sb.append("{hrUserProjectId=");
392		sb.append(getHrUserProjectId());
393		sb.append(", groupId=");
394		sb.append(getGroupId());
395		sb.append(", companyId=");
396		sb.append(getCompanyId());
397		sb.append(", userId=");
398		sb.append(getUserId());
399		sb.append(", userName=");
400		sb.append(getUserName());
401		sb.append(", createDate=");
402		sb.append(getCreateDate());
403		sb.append(", modifiedDate=");
404		sb.append(getModifiedDate());
405		sb.append(", hrProjectBillingRateId=");
406		sb.append(getHrProjectBillingRateId());
407		sb.append(", hrProjectId=");
408		sb.append(getHrProjectId());
409		sb.append(", hrProjectRoleId=");
410		sb.append(getHrProjectRoleId());
411		sb.append(", hrUserId=");
412		sb.append(getHrUserId());
413		sb.append(", actualRate=");
414		sb.append(getActualRate());
415		sb.append("}");
416
417		return sb.toString();
418	}
419
420	public String toXmlString() {
421		StringBundler sb = new StringBundler(40);
422
423		sb.append("<model><model-name>");
424		sb.append("com.liferay.hr.model.HRUserProject");
425		sb.append("</model-name>");
426
427		sb.append(
428			"<column><column-name>hrUserProjectId</column-name><column-value><![CDATA[");
429		sb.append(getHrUserProjectId());
430		sb.append("]]></column-value></column>");
431		sb.append(
432			"<column><column-name>groupId</column-name><column-value><![CDATA[");
433		sb.append(getGroupId());
434		sb.append("]]></column-value></column>");
435		sb.append(
436			"<column><column-name>companyId</column-name><column-value><![CDATA[");
437		sb.append(getCompanyId());
438		sb.append("]]></column-value></column>");
439		sb.append(
440			"<column><column-name>userId</column-name><column-value><![CDATA[");
441		sb.append(getUserId());
442		sb.append("]]></column-value></column>");
443		sb.append(
444			"<column><column-name>userName</column-name><column-value><![CDATA[");
445		sb.append(getUserName());
446		sb.append("]]></column-value></column>");
447		sb.append(
448			"<column><column-name>createDate</column-name><column-value><![CDATA[");
449		sb.append(getCreateDate());
450		sb.append("]]></column-value></column>");
451		sb.append(
452			"<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
453		sb.append(getModifiedDate());
454		sb.append("]]></column-value></column>");
455		sb.append(
456			"<column><column-name>hrProjectBillingRateId</column-name><column-value><![CDATA[");
457		sb.append(getHrProjectBillingRateId());
458		sb.append("]]></column-value></column>");
459		sb.append(
460			"<column><column-name>hrProjectId</column-name><column-value><![CDATA[");
461		sb.append(getHrProjectId());
462		sb.append("]]></column-value></column>");
463		sb.append(
464			"<column><column-name>hrProjectRoleId</column-name><column-value><![CDATA[");
465		sb.append(getHrProjectRoleId());
466		sb.append("]]></column-value></column>");
467		sb.append(
468			"<column><column-name>hrUserId</column-name><column-value><![CDATA[");
469		sb.append(getHrUserId());
470		sb.append("]]></column-value></column>");
471		sb.append(
472			"<column><column-name>actualRate</column-name><column-value><![CDATA[");
473		sb.append(getActualRate());
474		sb.append("]]></column-value></column>");
475
476		sb.append("</model>");
477
478		return sb.toString();
479	}
480
481	private static ClassLoader _classLoader = HRUserProject.class.getClassLoader();
482	private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
483			HRUserProject.class
484		};
485	private long _hrUserProjectId;
486	private long _groupId;
487	private long _companyId;
488	private long _userId;
489	private String _userUuid;
490	private String _userName;
491	private Date _createDate;
492	private Date _modifiedDate;
493	private long _hrProjectBillingRateId;
494	private long _hrProjectId;
495	private long _hrProjectRoleId;
496	private long _hrUserId;
497	private String _hrUserUuid;
498	private double _actualRate;
499	private transient ExpandoBridge _expandoBridge;
500	private HRUserProject _escapedModelProxy;
501}