com.liferay.depot.model.impl.DepotEntryGroupRelModelImpl Maven / Gradle / Ivy
/**
* 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.depot.model.impl;
import com.liferay.depot.model.DepotEntryGroupRel;
import com.liferay.depot.model.DepotEntryGroupRelModel;
import com.liferay.depot.model.DepotEntryGroupRelSoap;
import com.liferay.expando.kernel.model.ExpandoBridge;
import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
import com.liferay.petra.string.StringBundler;
import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.json.JSON;
import com.liferay.portal.kernel.model.CacheModel;
import com.liferay.portal.kernel.model.ModelWrapper;
import com.liferay.portal.kernel.model.impl.BaseModelImpl;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.util.ProxyUtil;
import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Function;
/**
* The base model implementation for the DepotEntryGroupRel service. Represents a row in the "DepotEntryGroupRel" database table, with each column mapped to a property of this class.
*
*
* This implementation and its corresponding interface DepotEntryGroupRelModel
exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link DepotEntryGroupRelImpl}.
*
*
* @author Brian Wing Shun Chan
* @see DepotEntryGroupRelImpl
* @generated
*/
@JSON(strict = true)
public class DepotEntryGroupRelModelImpl
extends BaseModelImpl
implements DepotEntryGroupRelModel {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. All methods that expect a depot entry group rel model instance should use the DepotEntryGroupRel
interface instead.
*/
public static final String TABLE_NAME = "DepotEntryGroupRel";
public static final Object[][] TABLE_COLUMNS = {
{"mvccVersion", Types.BIGINT}, {"depotEntryGroupRelId", Types.BIGINT},
{"companyId", Types.BIGINT}, {"depotEntryId", Types.BIGINT},
{"searchable", Types.BOOLEAN}, {"toGroupId", Types.BIGINT}
};
public static final Map TABLE_COLUMNS_MAP =
new HashMap();
static {
TABLE_COLUMNS_MAP.put("mvccVersion", Types.BIGINT);
TABLE_COLUMNS_MAP.put("depotEntryGroupRelId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("depotEntryId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("searchable", Types.BOOLEAN);
TABLE_COLUMNS_MAP.put("toGroupId", Types.BIGINT);
}
public static final String TABLE_SQL_CREATE =
"create table DepotEntryGroupRel (mvccVersion LONG default 0 not null,depotEntryGroupRelId LONG not null primary key,companyId LONG,depotEntryId LONG,searchable BOOLEAN,toGroupId LONG)";
public static final String TABLE_SQL_DROP = "drop table DepotEntryGroupRel";
public static final String ORDER_BY_JPQL =
" ORDER BY depotEntryGroupRel.depotEntryGroupRelId ASC";
public static final String ORDER_BY_SQL =
" ORDER BY DepotEntryGroupRel.depotEntryGroupRelId 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 long DEPOTENTRYID_COLUMN_BITMASK = 1L;
public static final long SEARCHABLE_COLUMN_BITMASK = 2L;
public static final long TOGROUPID_COLUMN_BITMASK = 4L;
public static final long DEPOTENTRYGROUPRELID_COLUMN_BITMASK = 8L;
public static void setEntityCacheEnabled(boolean entityCacheEnabled) {
_entityCacheEnabled = entityCacheEnabled;
}
public static void setFinderCacheEnabled(boolean finderCacheEnabled) {
_finderCacheEnabled = finderCacheEnabled;
}
/**
* Converts the soap model instance into a normal model instance.
*
* @param soapModel the soap model instance to convert
* @return the normal model instance
*/
public static DepotEntryGroupRel toModel(DepotEntryGroupRelSoap soapModel) {
if (soapModel == null) {
return null;
}
DepotEntryGroupRel model = new DepotEntryGroupRelImpl();
model.setMvccVersion(soapModel.getMvccVersion());
model.setDepotEntryGroupRelId(soapModel.getDepotEntryGroupRelId());
model.setCompanyId(soapModel.getCompanyId());
model.setDepotEntryId(soapModel.getDepotEntryId());
model.setSearchable(soapModel.isSearchable());
model.setToGroupId(soapModel.getToGroupId());
return model;
}
/**
* Converts the soap model instances into normal model instances.
*
* @param soapModels the soap model instances to convert
* @return the normal model instances
*/
public static List toModels(
DepotEntryGroupRelSoap[] soapModels) {
if (soapModels == null) {
return null;
}
List models = new ArrayList(
soapModels.length);
for (DepotEntryGroupRelSoap soapModel : soapModels) {
models.add(toModel(soapModel));
}
return models;
}
public DepotEntryGroupRelModelImpl() {
}
@Override
public long getPrimaryKey() {
return _depotEntryGroupRelId;
}
@Override
public void setPrimaryKey(long primaryKey) {
setDepotEntryGroupRelId(primaryKey);
}
@Override
public Serializable getPrimaryKeyObj() {
return _depotEntryGroupRelId;
}
@Override
public void setPrimaryKeyObj(Serializable primaryKeyObj) {
setPrimaryKey(((Long)primaryKeyObj).longValue());
}
@Override
public Class> getModelClass() {
return DepotEntryGroupRel.class;
}
@Override
public String getModelClassName() {
return DepotEntryGroupRel.class.getName();
}
@Override
public Map getModelAttributes() {
Map attributes = new HashMap();
Map>
attributeGetterFunctions = getAttributeGetterFunctions();
for (Map.Entry> entry :
attributeGetterFunctions.entrySet()) {
String attributeName = entry.getKey();
Function attributeGetterFunction =
entry.getValue();
attributes.put(
attributeName,
attributeGetterFunction.apply((DepotEntryGroupRel)this));
}
attributes.put("entityCacheEnabled", isEntityCacheEnabled());
attributes.put("finderCacheEnabled", isFinderCacheEnabled());
return attributes;
}
@Override
public void setModelAttributes(Map attributes) {
Map>
attributeSetterBiConsumers = getAttributeSetterBiConsumers();
for (Map.Entry entry : attributes.entrySet()) {
String attributeName = entry.getKey();
BiConsumer attributeSetterBiConsumer =
attributeSetterBiConsumers.get(attributeName);
if (attributeSetterBiConsumer != null) {
attributeSetterBiConsumer.accept(
(DepotEntryGroupRel)this, entry.getValue());
}
}
}
public Map>
getAttributeGetterFunctions() {
return _attributeGetterFunctions;
}
public Map>
getAttributeSetterBiConsumers() {
return _attributeSetterBiConsumers;
}
private static Function
_getProxyProviderFunction() {
Class> proxyClass = ProxyUtil.getProxyClass(
DepotEntryGroupRel.class.getClassLoader(), DepotEntryGroupRel.class,
ModelWrapper.class);
try {
Constructor constructor =
(Constructor)proxyClass.getConstructor(
InvocationHandler.class);
return invocationHandler -> {
try {
return constructor.newInstance(invocationHandler);
}
catch (ReflectiveOperationException
reflectiveOperationException) {
throw new InternalError(reflectiveOperationException);
}
};
}
catch (NoSuchMethodException noSuchMethodException) {
throw new InternalError(noSuchMethodException);
}
}
private static final Map>
_attributeGetterFunctions;
private static final Map>
_attributeSetterBiConsumers;
static {
Map>
attributeGetterFunctions =
new LinkedHashMap
>();
Map>
attributeSetterBiConsumers =
new LinkedHashMap>();
attributeGetterFunctions.put(
"mvccVersion", DepotEntryGroupRel::getMvccVersion);
attributeSetterBiConsumers.put(
"mvccVersion",
(BiConsumer)
DepotEntryGroupRel::setMvccVersion);
attributeGetterFunctions.put(
"depotEntryGroupRelId",
DepotEntryGroupRel::getDepotEntryGroupRelId);
attributeSetterBiConsumers.put(
"depotEntryGroupRelId",
(BiConsumer)
DepotEntryGroupRel::setDepotEntryGroupRelId);
attributeGetterFunctions.put(
"companyId", DepotEntryGroupRel::getCompanyId);
attributeSetterBiConsumers.put(
"companyId",
(BiConsumer)
DepotEntryGroupRel::setCompanyId);
attributeGetterFunctions.put(
"depotEntryId", DepotEntryGroupRel::getDepotEntryId);
attributeSetterBiConsumers.put(
"depotEntryId",
(BiConsumer)
DepotEntryGroupRel::setDepotEntryId);
attributeGetterFunctions.put(
"searchable", DepotEntryGroupRel::getSearchable);
attributeSetterBiConsumers.put(
"searchable",
(BiConsumer)
DepotEntryGroupRel::setSearchable);
attributeGetterFunctions.put(
"toGroupId", DepotEntryGroupRel::getToGroupId);
attributeSetterBiConsumers.put(
"toGroupId",
(BiConsumer)
DepotEntryGroupRel::setToGroupId);
_attributeGetterFunctions = Collections.unmodifiableMap(
attributeGetterFunctions);
_attributeSetterBiConsumers = Collections.unmodifiableMap(
(Map)attributeSetterBiConsumers);
}
@JSON
@Override
public long getMvccVersion() {
return _mvccVersion;
}
@Override
public void setMvccVersion(long mvccVersion) {
_mvccVersion = mvccVersion;
}
@JSON
@Override
public long getDepotEntryGroupRelId() {
return _depotEntryGroupRelId;
}
@Override
public void setDepotEntryGroupRelId(long depotEntryGroupRelId) {
_depotEntryGroupRelId = depotEntryGroupRelId;
}
@JSON
@Override
public long getCompanyId() {
return _companyId;
}
@Override
public void setCompanyId(long companyId) {
_companyId = companyId;
}
@JSON
@Override
public long getDepotEntryId() {
return _depotEntryId;
}
@Override
public void setDepotEntryId(long depotEntryId) {
_columnBitmask |= DEPOTENTRYID_COLUMN_BITMASK;
if (!_setOriginalDepotEntryId) {
_setOriginalDepotEntryId = true;
_originalDepotEntryId = _depotEntryId;
}
_depotEntryId = depotEntryId;
}
public long getOriginalDepotEntryId() {
return _originalDepotEntryId;
}
@JSON
@Override
public boolean getSearchable() {
return _searchable;
}
@JSON
@Override
public boolean isSearchable() {
return _searchable;
}
@Override
public void setSearchable(boolean searchable) {
_columnBitmask |= SEARCHABLE_COLUMN_BITMASK;
if (!_setOriginalSearchable) {
_setOriginalSearchable = true;
_originalSearchable = _searchable;
}
_searchable = searchable;
}
public boolean getOriginalSearchable() {
return _originalSearchable;
}
@JSON
@Override
public long getToGroupId() {
return _toGroupId;
}
@Override
public void setToGroupId(long toGroupId) {
_columnBitmask |= TOGROUPID_COLUMN_BITMASK;
if (!_setOriginalToGroupId) {
_setOriginalToGroupId = true;
_originalToGroupId = _toGroupId;
}
_toGroupId = toGroupId;
}
public long getOriginalToGroupId() {
return _originalToGroupId;
}
public long getColumnBitmask() {
return _columnBitmask;
}
@Override
public ExpandoBridge getExpandoBridge() {
return ExpandoBridgeFactoryUtil.getExpandoBridge(
getCompanyId(), DepotEntryGroupRel.class.getName(),
getPrimaryKey());
}
@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
ExpandoBridge expandoBridge = getExpandoBridge();
expandoBridge.setAttributes(serviceContext);
}
@Override
public DepotEntryGroupRel toEscapedModel() {
if (_escapedModel == null) {
Function
escapedModelProxyProviderFunction =
EscapedModelProxyProviderFunctionHolder.
_escapedModelProxyProviderFunction;
_escapedModel = escapedModelProxyProviderFunction.apply(
new AutoEscapeBeanHandler(this));
}
return _escapedModel;
}
@Override
public Object clone() {
DepotEntryGroupRelImpl depotEntryGroupRelImpl =
new DepotEntryGroupRelImpl();
depotEntryGroupRelImpl.setMvccVersion(getMvccVersion());
depotEntryGroupRelImpl.setDepotEntryGroupRelId(
getDepotEntryGroupRelId());
depotEntryGroupRelImpl.setCompanyId(getCompanyId());
depotEntryGroupRelImpl.setDepotEntryId(getDepotEntryId());
depotEntryGroupRelImpl.setSearchable(isSearchable());
depotEntryGroupRelImpl.setToGroupId(getToGroupId());
depotEntryGroupRelImpl.resetOriginalValues();
return depotEntryGroupRelImpl;
}
@Override
public int compareTo(DepotEntryGroupRel depotEntryGroupRel) {
long primaryKey = depotEntryGroupRel.getPrimaryKey();
if (getPrimaryKey() < primaryKey) {
return -1;
}
else if (getPrimaryKey() > primaryKey) {
return 1;
}
else {
return 0;
}
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof DepotEntryGroupRel)) {
return false;
}
DepotEntryGroupRel depotEntryGroupRel = (DepotEntryGroupRel)obj;
long primaryKey = depotEntryGroupRel.getPrimaryKey();
if (getPrimaryKey() == primaryKey) {
return true;
}
else {
return false;
}
}
@Override
public int hashCode() {
return (int)getPrimaryKey();
}
@Override
public boolean isEntityCacheEnabled() {
return _entityCacheEnabled;
}
@Override
public boolean isFinderCacheEnabled() {
return _finderCacheEnabled;
}
@Override
public void resetOriginalValues() {
DepotEntryGroupRelModelImpl depotEntryGroupRelModelImpl = this;
depotEntryGroupRelModelImpl._originalDepotEntryId =
depotEntryGroupRelModelImpl._depotEntryId;
depotEntryGroupRelModelImpl._setOriginalDepotEntryId = false;
depotEntryGroupRelModelImpl._originalSearchable =
depotEntryGroupRelModelImpl._searchable;
depotEntryGroupRelModelImpl._setOriginalSearchable = false;
depotEntryGroupRelModelImpl._originalToGroupId =
depotEntryGroupRelModelImpl._toGroupId;
depotEntryGroupRelModelImpl._setOriginalToGroupId = false;
depotEntryGroupRelModelImpl._columnBitmask = 0;
}
@Override
public CacheModel toCacheModel() {
DepotEntryGroupRelCacheModel depotEntryGroupRelCacheModel =
new DepotEntryGroupRelCacheModel();
depotEntryGroupRelCacheModel.mvccVersion = getMvccVersion();
depotEntryGroupRelCacheModel.depotEntryGroupRelId =
getDepotEntryGroupRelId();
depotEntryGroupRelCacheModel.companyId = getCompanyId();
depotEntryGroupRelCacheModel.depotEntryId = getDepotEntryId();
depotEntryGroupRelCacheModel.searchable = isSearchable();
depotEntryGroupRelCacheModel.toGroupId = getToGroupId();
return depotEntryGroupRelCacheModel;
}
@Override
public String toString() {
Map>
attributeGetterFunctions = getAttributeGetterFunctions();
StringBundler sb = new StringBundler(
4 * attributeGetterFunctions.size() + 2);
sb.append("{");
for (Map.Entry> entry :
attributeGetterFunctions.entrySet()) {
String attributeName = entry.getKey();
Function attributeGetterFunction =
entry.getValue();
sb.append(attributeName);
sb.append("=");
sb.append(attributeGetterFunction.apply((DepotEntryGroupRel)this));
sb.append(", ");
}
if (sb.index() > 1) {
sb.setIndex(sb.index() - 1);
}
sb.append("}");
return sb.toString();
}
@Override
public String toXmlString() {
Map>
attributeGetterFunctions = getAttributeGetterFunctions();
StringBundler sb = new StringBundler(
5 * attributeGetterFunctions.size() + 4);
sb.append("");
sb.append(getModelClassName());
sb.append(" ");
for (Map.Entry> entry :
attributeGetterFunctions.entrySet()) {
String attributeName = entry.getKey();
Function attributeGetterFunction =
entry.getValue();
sb.append("");
sb.append(attributeName);
sb.append(" ");
}
sb.append(" ");
return sb.toString();
}
private static class EscapedModelProxyProviderFunctionHolder {
private static final Function
_escapedModelProxyProviderFunction = _getProxyProviderFunction();
}
private static boolean _entityCacheEnabled;
private static boolean _finderCacheEnabled;
private long _mvccVersion;
private long _depotEntryGroupRelId;
private long _companyId;
private long _depotEntryId;
private long _originalDepotEntryId;
private boolean _setOriginalDepotEntryId;
private boolean _searchable;
private boolean _originalSearchable;
private boolean _setOriginalSearchable;
private long _toGroupId;
private long _originalToGroupId;
private boolean _setOriginalToGroupId;
private long _columnBitmask;
private DepotEntryGroupRel _escapedModel;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy