/**
* Copyright (c) 2000-present 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.portal.model.impl;
import aQute.bnd.annotation.ProviderType;
import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.model.CacheModel;
import com.liferay.portal.kernel.model.OrgGroupRole;
import com.liferay.portal.kernel.model.OrgGroupRoleModel;
import com.liferay.portal.kernel.model.impl.BaseModelImpl;
import com.liferay.portal.kernel.service.persistence.OrgGroupRolePK;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import java.io.Serializable;
import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
/**
* The base model implementation for the OrgGroupRole service. Represents a row in the "OrgGroupRole" database table, with each column mapped to a property of this class.
*
* <p>
* This implementation and its corresponding interface {@link OrgGroupRoleModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link OrgGroupRoleImpl}.
* </p>
*
* @author Brian Wing Shun Chan
* @see OrgGroupRoleImpl
* @see OrgGroupRole
* @see OrgGroupRoleModel
* @generated
*/
@ProviderType
public class OrgGroupRoleModelImpl extends BaseModelImpl<OrgGroupRole>
implements OrgGroupRoleModel {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. All methods that expect a org group role model instance should use the {@link OrgGroupRole} interface instead.
*/
public static final String TABLE_NAME = "OrgGroupRole";
public static final Object[][] TABLE_COLUMNS = {
{ "mvccVersion", Types.BIGINT },
{ "organizationId", Types.BIGINT },
{ "groupId", Types.BIGINT },
{ "roleId", Types.BIGINT },
{ "companyId", Types.BIGINT }
};
public static final Map<String, Integer> TABLE_COLUMNS_MAP = new HashMap<String, Integer>();
static {
TABLE_COLUMNS_MAP.put("mvccVersion", Types.BIGINT);
TABLE_COLUMNS_MAP.put("organizationId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("groupId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("roleId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT);
}
public static final String TABLE_SQL_CREATE = "create table OrgGroupRole (mvccVersion LONG default 0 not null,organizationId LONG not null,groupId LONG not null,roleId LONG not null,companyId LONG,primary key (organizationId, groupId, roleId))";
public static final String TABLE_SQL_DROP = "drop table OrgGroupRole";
public static final String ORDER_BY_JPQL = " ORDER BY orgGroupRole.id.organizationId ASC, orgGroupRole.id.groupId ASC, orgGroupRole.id.roleId ASC";
public static final String ORDER_BY_SQL = " ORDER BY OrgGroupRole.organizationId ASC, OrgGroupRole.groupId ASC, OrgGroupRole.roleId ASC";
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.portal.util.PropsUtil.get(
"value.object.entity.cache.enabled.com.liferay.portal.kernel.model.OrgGroupRole"),
true);
public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
"value.object.finder.cache.enabled.com.liferay.portal.kernel.model.OrgGroupRole"),
true);
public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
"value.object.column.bitmask.enabled.com.liferay.portal.kernel.model.OrgGroupRole"),
true);
public static final long GROUPID_COLUMN_BITMASK = 1L;
public static final long ROLEID_COLUMN_BITMASK = 2L;
public static final long ORGANIZATIONID_COLUMN_BITMASK = 4L;
public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
"lock.expiration.time.com.liferay.portal.kernel.model.OrgGroupRole"));
public OrgGroupRoleModelImpl() {
}
@Override
public OrgGroupRolePK getPrimaryKey() {
return new OrgGroupRolePK(_organizationId, _groupId, _roleId);
}
@Override
public void setPrimaryKey(OrgGroupRolePK primaryKey) {
setOrganizationId(primaryKey.organizationId);
setGroupId(primaryKey.groupId);
setRoleId(primaryKey.roleId);
}
@Override
public Serializable getPrimaryKeyObj() {
return new OrgGroupRolePK(_organizationId, _groupId, _roleId);
}
@Override
public void setPrimaryKeyObj(Serializable primaryKeyObj) {
setPrimaryKey((OrgGroupRolePK)primaryKeyObj);
}
@Override
public Class<?> getModelClass() {
return OrgGroupRole.class;
}
@Override
public String getModelClassName() {
return OrgGroupRole.class.getName();
}
@Override
public Map<String, Object> getModelAttributes() {
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("mvccVersion", getMvccVersion());
attributes.put("organizationId", getOrganizationId());
attributes.put("groupId", getGroupId());
attributes.put("roleId", getRoleId());
attributes.put("companyId", getCompanyId());
attributes.put("entityCacheEnabled", isEntityCacheEnabled());
attributes.put("finderCacheEnabled", isFinderCacheEnabled());
return attributes;
}
@Override
public void setModelAttributes(Map<String, Object> attributes) {
Long mvccVersion = (Long)attributes.get("mvccVersion");
if (mvccVersion != null) {
setMvccVersion(mvccVersion);
}
Long organizationId = (Long)attributes.get("organizationId");
if (organizationId != null) {
setOrganizationId(organizationId);
}
Long groupId = (Long)attributes.get("groupId");
if (groupId != null) {
setGroupId(groupId);
}
Long roleId = (Long)attributes.get("roleId");
if (roleId != null) {
setRoleId(roleId);
}
Long companyId = (Long)attributes.get("companyId");
if (companyId != null) {
setCompanyId(companyId);
}
}
@Override
public long getMvccVersion() {
return _mvccVersion;
}
@Override
public void setMvccVersion(long mvccVersion) {
_mvccVersion = mvccVersion;
}
@Override
public long getOrganizationId() {
return _organizationId;
}
@Override
public void setOrganizationId(long organizationId) {
_organizationId = organizationId;
}
@Override
public long getGroupId() {
return _groupId;
}
@Override
public void setGroupId(long groupId) {
_columnBitmask |= GROUPID_COLUMN_BITMASK;
if (!_setOriginalGroupId) {
_setOriginalGroupId = true;
_originalGroupId = _groupId;
}
_groupId = groupId;
}
public long getOriginalGroupId() {
return _originalGroupId;
}
@Override
public long getRoleId() {
return _roleId;
}
@Override
public void setRoleId(long roleId) {
_columnBitmask |= ROLEID_COLUMN_BITMASK;
if (!_setOriginalRoleId) {
_setOriginalRoleId = true;
_originalRoleId = _roleId;
}
_roleId = roleId;
}
public long getOriginalRoleId() {
return _originalRoleId;
}
@Override
public long getCompanyId() {
return _companyId;
}
@Override
public void setCompanyId(long companyId) {
_companyId = companyId;
}
public long getColumnBitmask() {
return _columnBitmask;
}
@Override
public OrgGroupRole toEscapedModel() {
if (_escapedModel == null) {
_escapedModel = (OrgGroupRole)ProxyUtil.newProxyInstance(_classLoader,
_escapedModelInterfaces, new AutoEscapeBeanHandler(this));
}
return _escapedModel;
}
@Override
public Object clone() {
OrgGroupRoleImpl orgGroupRoleImpl = new OrgGroupRoleImpl();
orgGroupRoleImpl.setMvccVersion(getMvccVersion());
orgGroupRoleImpl.setOrganizationId(getOrganizationId());
orgGroupRoleImpl.setGroupId(getGroupId());
orgGroupRoleImpl.setRoleId(getRoleId());
orgGroupRoleImpl.setCompanyId(getCompanyId());
orgGroupRoleImpl.resetOriginalValues();
return orgGroupRoleImpl;
}
@Override
public int compareTo(OrgGroupRole orgGroupRole) {
OrgGroupRolePK primaryKey = orgGroupRole.getPrimaryKey();
return getPrimaryKey().compareTo(primaryKey);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof OrgGroupRole)) {
return false;
}
OrgGroupRole orgGroupRole = (OrgGroupRole)obj;
OrgGroupRolePK primaryKey = orgGroupRole.getPrimaryKey();
if (getPrimaryKey().equals(primaryKey)) {
return true;
}
else {
return false;
}
}
@Override
public int hashCode() {
return getPrimaryKey().hashCode();
}
@Override
public boolean isEntityCacheEnabled() {
return ENTITY_CACHE_ENABLED;
}
@Override
public boolean isFinderCacheEnabled() {
return FINDER_CACHE_ENABLED;
}
@Override
public void resetOriginalValues() {
OrgGroupRoleModelImpl orgGroupRoleModelImpl = this;
orgGroupRoleModelImpl._originalGroupId = orgGroupRoleModelImpl._groupId;
orgGroupRoleModelImpl._setOriginalGroupId = false;
orgGroupRoleModelImpl._originalRoleId = orgGroupRoleModelImpl._roleId;
orgGroupRoleModelImpl._setOriginalRoleId = false;
orgGroupRoleModelImpl._columnBitmask = 0;
}
@Override
public CacheModel<OrgGroupRole> toCacheModel() {
OrgGroupRoleCacheModel orgGroupRoleCacheModel = new OrgGroupRoleCacheModel();
orgGroupRoleCacheModel.orgGroupRolePK = getPrimaryKey();
orgGroupRoleCacheModel.mvccVersion = getMvccVersion();
orgGroupRoleCacheModel.organizationId = getOrganizationId();
orgGroupRoleCacheModel.groupId = getGroupId();
orgGroupRoleCacheModel.roleId = getRoleId();
orgGroupRoleCacheModel.companyId = getCompanyId();
return orgGroupRoleCacheModel;
}
@Override
public String toString() {
StringBundler sb = new StringBundler(11);
sb.append("{mvccVersion=");
sb.append(getMvccVersion());
sb.append(", organizationId=");
sb.append(getOrganizationId());
sb.append(", groupId=");
sb.append(getGroupId());
sb.append(", roleId=");
sb.append(getRoleId());
sb.append(", companyId=");
sb.append(getCompanyId());
sb.append("}");
return sb.toString();
}
@Override
public String toXmlString() {
StringBundler sb = new StringBundler(19);
sb.append("<model><model-name>");
sb.append("com.liferay.portal.kernel.model.OrgGroupRole");
sb.append("</model-name>");
sb.append(
"<column><column-name>mvccVersion</column-name><column-value><![CDATA[");
sb.append(getMvccVersion());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>organizationId</column-name><column-value><![CDATA[");
sb.append(getOrganizationId());
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>roleId</column-name><column-value><![CDATA[");
sb.append(getRoleId());
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("</model>");
return sb.toString();
}
private static final ClassLoader _classLoader = OrgGroupRole.class.getClassLoader();
private static final Class<?>[] _escapedModelInterfaces = new Class[] {
OrgGroupRole.class
};
private long _mvccVersion;
private long _organizationId;
private long _groupId;
private long _originalGroupId;
private boolean _setOriginalGroupId;
private long _roleId;
private long _originalRoleId;
private boolean _setOriginalRoleId;
private long _companyId;
private long _columnBitmask;
private OrgGroupRole _escapedModel;
}