/portlets/hr-portlet/docroot/WEB-INF/src/com/liferay/hr/model/impl/HRUserProjectModelImpl.java
Java | 501 lines | 380 code | 90 blank | 31 comment | 28 complexity | 5a552368394cb69aed3cd134eccbf577 MD5 | raw file
- /**
- * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
- package com.liferay.hr.model.impl;
- import com.liferay.hr.model.HRUserProject;
- import com.liferay.hr.model.HRUserProjectModel;
- import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
- import com.liferay.portal.kernel.exception.SystemException;
- import com.liferay.portal.kernel.util.GetterUtil;
- import com.liferay.portal.kernel.util.StringBundler;
- import com.liferay.portal.kernel.util.StringPool;
- import com.liferay.portal.model.CacheModel;
- import com.liferay.portal.model.impl.BaseModelImpl;
- import com.liferay.portal.service.ServiceContext;
- import com.liferay.portal.util.PortalUtil;
- import com.liferay.portlet.expando.model.ExpandoBridge;
- import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
- import java.io.Serializable;
- import java.lang.reflect.Proxy;
- import java.sql.Types;
- import java.util.Date;
- /**
- * 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.
- *
- * <p>
- * 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}.
- * </p>
- *
- * @author Wesley Gong
- * @see HRUserProjectImpl
- * @see com.liferay.hr.model.HRUserProject
- * @see com.liferay.hr.model.HRUserProjectModel
- * @generated
- */
- public class HRUserProjectModelImpl extends BaseModelImpl<HRUserProject>
- implements HRUserProjectModel {
- /*
- * NOTE FOR DEVELOPERS:
- *
- * 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.
- */
- public static final String TABLE_NAME = "HRUserProject";
- public static final Object[][] TABLE_COLUMNS = {
- { "hrUserProjectId", Types.BIGINT },
- { "groupId", Types.BIGINT },
- { "companyId", Types.BIGINT },
- { "userId", Types.BIGINT },
- { "userName", Types.VARCHAR },
- { "createDate", Types.TIMESTAMP },
- { "modifiedDate", Types.TIMESTAMP },
- { "hrProjectBillingRateId", Types.BIGINT },
- { "hrProjectId", Types.BIGINT },
- { "hrProjectRoleId", Types.BIGINT },
- { "hrUserId", Types.BIGINT },
- { "actualRate", Types.DOUBLE }
- };
- 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)";
- public static final String TABLE_SQL_DROP = "drop table HRUserProject";
- public static final String DATA_SOURCE = "liferayDataSource";
- public static final String SESSION_FACTORY = "liferaySessionFactory";
- public static final String TX_MANAGER = "liferayTransactionManager";
- public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
- "value.object.entity.cache.enabled.com.liferay.hr.model.HRUserProject"),
- true);
- public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
- "value.object.finder.cache.enabled.com.liferay.hr.model.HRUserProject"),
- true);
- public Class<?> getModelClass() {
- return HRUserProject.class;
- }
- public String getModelClassName() {
- return HRUserProject.class.getName();
- }
- public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
- "lock.expiration.time.com.liferay.hr.model.HRUserProject"));
- public HRUserProjectModelImpl() {
- }
- public long getPrimaryKey() {
- return _hrUserProjectId;
- }
- public void setPrimaryKey(long primaryKey) {
- setHrUserProjectId(primaryKey);
- }
- public Serializable getPrimaryKeyObj() {
- return new Long(_hrUserProjectId);
- }
- public void setPrimaryKeyObj(Serializable primaryKeyObj) {
- setPrimaryKey(((Long)primaryKeyObj).longValue());
- }
- public long getHrUserProjectId() {
- return _hrUserProjectId;
- }
- public void setHrUserProjectId(long hrUserProjectId) {
- _hrUserProjectId = hrUserProjectId;
- }
- public long getGroupId() {
- return _groupId;
- }
- public void setGroupId(long groupId) {
- _groupId = groupId;
- }
- public long getCompanyId() {
- return _companyId;
- }
- public void setCompanyId(long companyId) {
- _companyId = companyId;
- }
- public long getUserId() {
- return _userId;
- }
- public void setUserId(long userId) {
- _userId = userId;
- }
- public String getUserUuid() throws SystemException {
- return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
- }
- public void setUserUuid(String userUuid) {
- _userUuid = userUuid;
- }
- public String getUserName() {
- if (_userName == null) {
- return StringPool.BLANK;
- }
- else {
- return _userName;
- }
- }
- public void setUserName(String userName) {
- _userName = userName;
- }
- public Date getCreateDate() {
- return _createDate;
- }
- public void setCreateDate(Date createDate) {
- _createDate = createDate;
- }
- public Date getModifiedDate() {
- return _modifiedDate;
- }
- public void setModifiedDate(Date modifiedDate) {
- _modifiedDate = modifiedDate;
- }
- public long getHrProjectBillingRateId() {
- return _hrProjectBillingRateId;
- }
- public void setHrProjectBillingRateId(long hrProjectBillingRateId) {
- _hrProjectBillingRateId = hrProjectBillingRateId;
- }
- public long getHrProjectId() {
- return _hrProjectId;
- }
- public void setHrProjectId(long hrProjectId) {
- _hrProjectId = hrProjectId;
- }
- public long getHrProjectRoleId() {
- return _hrProjectRoleId;
- }
- public void setHrProjectRoleId(long hrProjectRoleId) {
- _hrProjectRoleId = hrProjectRoleId;
- }
- public long getHrUserId() {
- return _hrUserId;
- }
- public void setHrUserId(long hrUserId) {
- _hrUserId = hrUserId;
- }
- public String getHrUserUuid() throws SystemException {
- return PortalUtil.getUserValue(getHrUserId(), "uuid", _hrUserUuid);
- }
- public void setHrUserUuid(String hrUserUuid) {
- _hrUserUuid = hrUserUuid;
- }
- public double getActualRate() {
- return _actualRate;
- }
- public void setActualRate(double actualRate) {
- _actualRate = actualRate;
- }
- @Override
- public HRUserProject toEscapedModel() {
- if (isEscapedModel()) {
- return (HRUserProject)this;
- }
- else {
- if (_escapedModelProxy == null) {
- _escapedModelProxy = (HRUserProject)Proxy.newProxyInstance(_classLoader,
- _escapedModelProxyInterfaces,
- new AutoEscapeBeanHandler(this));
- }
- return _escapedModelProxy;
- }
- }
- @Override
- public ExpandoBridge getExpandoBridge() {
- if (_expandoBridge == null) {
- _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
- HRUserProject.class.getName(), getPrimaryKey());
- }
- return _expandoBridge;
- }
- @Override
- public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
- getExpandoBridge().setAttributes(serviceContext);
- }
- @Override
- public Object clone() {
- HRUserProjectImpl hrUserProjectImpl = new HRUserProjectImpl();
- hrUserProjectImpl.setHrUserProjectId(getHrUserProjectId());
- hrUserProjectImpl.setGroupId(getGroupId());
- hrUserProjectImpl.setCompanyId(getCompanyId());
- hrUserProjectImpl.setUserId(getUserId());
- hrUserProjectImpl.setUserName(getUserName());
- hrUserProjectImpl.setCreateDate(getCreateDate());
- hrUserProjectImpl.setModifiedDate(getModifiedDate());
- hrUserProjectImpl.setHrProjectBillingRateId(getHrProjectBillingRateId());
- hrUserProjectImpl.setHrProjectId(getHrProjectId());
- hrUserProjectImpl.setHrProjectRoleId(getHrProjectRoleId());
- hrUserProjectImpl.setHrUserId(getHrUserId());
- hrUserProjectImpl.setActualRate(getActualRate());
- hrUserProjectImpl.resetOriginalValues();
- return hrUserProjectImpl;
- }
- public int compareTo(HRUserProject hrUserProject) {
- long primaryKey = hrUserProject.getPrimaryKey();
- if (getPrimaryKey() < primaryKey) {
- return -1;
- }
- else if (getPrimaryKey() > primaryKey) {
- return 1;
- }
- else {
- return 0;
- }
- }
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- HRUserProject hrUserProject = null;
- try {
- hrUserProject = (HRUserProject)obj;
- }
- catch (ClassCastException cce) {
- return false;
- }
- long primaryKey = hrUserProject.getPrimaryKey();
- if (getPrimaryKey() == primaryKey) {
- return true;
- }
- else {
- return false;
- }
- }
- @Override
- public int hashCode() {
- return (int)getPrimaryKey();
- }
- @Override
- public void resetOriginalValues() {
- }
- @Override
- public CacheModel<HRUserProject> toCacheModel() {
- HRUserProjectCacheModel hrUserProjectCacheModel = new HRUserProjectCacheModel();
- hrUserProjectCacheModel.hrUserProjectId = getHrUserProjectId();
- hrUserProjectCacheModel.groupId = getGroupId();
- hrUserProjectCacheModel.companyId = getCompanyId();
- hrUserProjectCacheModel.userId = getUserId();
- hrUserProjectCacheModel.userName = getUserName();
- String userName = hrUserProjectCacheModel.userName;
- if ((userName != null) && (userName.length() == 0)) {
- hrUserProjectCacheModel.userName = null;
- }
- Date createDate = getCreateDate();
- if (createDate != null) {
- hrUserProjectCacheModel.createDate = createDate.getTime();
- }
- else {
- hrUserProjectCacheModel.createDate = Long.MIN_VALUE;
- }
- Date modifiedDate = getModifiedDate();
- if (modifiedDate != null) {
- hrUserProjectCacheModel.modifiedDate = modifiedDate.getTime();
- }
- else {
- hrUserProjectCacheModel.modifiedDate = Long.MIN_VALUE;
- }
- hrUserProjectCacheModel.hrProjectBillingRateId = getHrProjectBillingRateId();
- hrUserProjectCacheModel.hrProjectId = getHrProjectId();
- hrUserProjectCacheModel.hrProjectRoleId = getHrProjectRoleId();
- hrUserProjectCacheModel.hrUserId = getHrUserId();
- hrUserProjectCacheModel.actualRate = getActualRate();
- return hrUserProjectCacheModel;
- }
- @Override
- public String toString() {
- StringBundler sb = new StringBundler(25);
- sb.append("{hrUserProjectId=");
- sb.append(getHrUserProjectId());
- sb.append(", groupId=");
- sb.append(getGroupId());
- sb.append(", companyId=");
- sb.append(getCompanyId());
- sb.append(", userId=");
- sb.append(getUserId());
- sb.append(", userName=");
- sb.append(getUserName());
- sb.append(", createDate=");
- sb.append(getCreateDate());
- sb.append(", modifiedDate=");
- sb.append(getModifiedDate());
- sb.append(", hrProjectBillingRateId=");
- sb.append(getHrProjectBillingRateId());
- sb.append(", hrProjectId=");
- sb.append(getHrProjectId());
- sb.append(", hrProjectRoleId=");
- sb.append(getHrProjectRoleId());
- sb.append(", hrUserId=");
- sb.append(getHrUserId());
- sb.append(", actualRate=");
- sb.append(getActualRate());
- sb.append("}");
- return sb.toString();
- }
- public String toXmlString() {
- StringBundler sb = new StringBundler(40);
- sb.append("<model><model-name>");
- sb.append("com.liferay.hr.model.HRUserProject");
- sb.append("</model-name>");
- sb.append(
- "<column><column-name>hrUserProjectId</column-name><column-value><![CDATA[");
- sb.append(getHrUserProjectId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>groupId</column-name><column-value><![CDATA[");
- sb.append(getGroupId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>companyId</column-name><column-value><![CDATA[");
- sb.append(getCompanyId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>userId</column-name><column-value><![CDATA[");
- sb.append(getUserId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>userName</column-name><column-value><![CDATA[");
- sb.append(getUserName());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>createDate</column-name><column-value><![CDATA[");
- sb.append(getCreateDate());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
- sb.append(getModifiedDate());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>hrProjectBillingRateId</column-name><column-value><![CDATA[");
- sb.append(getHrProjectBillingRateId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>hrProjectId</column-name><column-value><![CDATA[");
- sb.append(getHrProjectId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>hrProjectRoleId</column-name><column-value><![CDATA[");
- sb.append(getHrProjectRoleId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>hrUserId</column-name><column-value><![CDATA[");
- sb.append(getHrUserId());
- sb.append("]]></column-value></column>");
- sb.append(
- "<column><column-name>actualRate</column-name><column-value><![CDATA[");
- sb.append(getActualRate());
- sb.append("]]></column-value></column>");
- sb.append("</model>");
- return sb.toString();
- }
- private static ClassLoader _classLoader = HRUserProject.class.getClassLoader();
- private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
- HRUserProject.class
- };
- private long _hrUserProjectId;
- private long _groupId;
- private long _companyId;
- private long _userId;
- private String _userUuid;
- private String _userName;
- private Date _createDate;
- private Date _modifiedDate;
- private long _hrProjectBillingRateId;
- private long _hrProjectId;
- private long _hrProjectRoleId;
- private long _hrUserId;
- private String _hrUserUuid;
- private double _actualRate;
- private transient ExpandoBridge _expandoBridge;
- private HRUserProject _escapedModelProxy;
- }