All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.commerce.product.model.impl.CPInstanceModelImpl Maven / Gradle / Ivy

The newest version!
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */

package com.liferay.commerce.product.model.impl;

import com.liferay.commerce.product.model.CPInstance;
import com.liferay.commerce.product.model.CPInstanceModel;
import com.liferay.expando.kernel.model.ExpandoBridge;
import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
import com.liferay.exportimport.kernel.lar.StagedModelType;
import com.liferay.petra.string.StringBundler;
import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.PortalException;
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.User;
import com.liferay.portal.kernel.model.impl.BaseModelImpl;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.service.UserLocalServiceUtil;
import com.liferay.portal.kernel.util.DateUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;

import java.io.Serializable;

import java.lang.reflect.InvocationHandler;

import java.math.BigDecimal;

import java.sql.Blob;
import java.sql.Types;

import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.Function;

/**
 * The base model implementation for the CPInstance service. Represents a row in the "CPInstance" database table, with each column mapped to a property of this class.
 *
 * 

* This implementation and its corresponding interface CPInstanceModel exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CPInstanceImpl}. *

* * @author Marco Leo * @see CPInstanceImpl * @generated */ @JSON(strict = true) public class CPInstanceModelImpl extends BaseModelImpl implements CPInstanceModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a cp instance model instance should use the CPInstance interface instead. */ public static final String TABLE_NAME = "CPInstance"; public static final Object[][] TABLE_COLUMNS = { {"mvccVersion", Types.BIGINT}, {"ctCollectionId", Types.BIGINT}, {"uuid_", Types.VARCHAR}, {"externalReferenceCode", Types.VARCHAR}, {"CPInstanceId", Types.BIGINT}, {"groupId", Types.BIGINT}, {"companyId", Types.BIGINT}, {"userId", Types.BIGINT}, {"userName", Types.VARCHAR}, {"createDate", Types.TIMESTAMP}, {"modifiedDate", Types.TIMESTAMP}, {"CPDefinitionId", Types.BIGINT}, {"CPInstanceUuid", Types.VARCHAR}, {"sku", Types.VARCHAR}, {"gtin", Types.VARCHAR}, {"manufacturerPartNumber", Types.VARCHAR}, {"purchasable", Types.BOOLEAN}, {"width", Types.DOUBLE}, {"height", Types.DOUBLE}, {"depth", Types.DOUBLE}, {"weight", Types.DOUBLE}, {"price", Types.DECIMAL}, {"promoPrice", Types.DECIMAL}, {"cost", Types.DECIMAL}, {"published", Types.BOOLEAN}, {"displayDate", Types.TIMESTAMP}, {"expirationDate", Types.TIMESTAMP}, {"lastPublishDate", Types.TIMESTAMP}, {"overrideSubscriptionInfo", Types.BOOLEAN}, {"subscriptionEnabled", Types.BOOLEAN}, {"subscriptionLength", Types.INTEGER}, {"subscriptionType", Types.VARCHAR}, {"subscriptionTypeSettings", Types.CLOB}, {"maxSubscriptionCycles", Types.BIGINT}, {"deliverySubscriptionEnabled", Types.BOOLEAN}, {"deliverySubscriptionLength", Types.INTEGER}, {"deliverySubscriptionType", Types.VARCHAR}, {"deliverySubTypeSettings", Types.VARCHAR}, {"deliveryMaxSubscriptionCycles", Types.BIGINT}, {"unspsc", Types.VARCHAR}, {"discontinued", Types.BOOLEAN}, {"discontinuedDate", Types.TIMESTAMP}, {"replacementCPInstanceUuid", Types.VARCHAR}, {"replacementCProductId", Types.BIGINT}, {"status", Types.INTEGER}, {"statusByUserId", Types.BIGINT}, {"statusByUserName", Types.VARCHAR}, {"statusDate", Types.TIMESTAMP} }; public static final Map TABLE_COLUMNS_MAP = new HashMap(); static { TABLE_COLUMNS_MAP.put("mvccVersion", Types.BIGINT); TABLE_COLUMNS_MAP.put("ctCollectionId", Types.BIGINT); TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR); TABLE_COLUMNS_MAP.put("externalReferenceCode", Types.VARCHAR); TABLE_COLUMNS_MAP.put("CPInstanceId", Types.BIGINT); TABLE_COLUMNS_MAP.put("groupId", Types.BIGINT); TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT); TABLE_COLUMNS_MAP.put("userId", Types.BIGINT); TABLE_COLUMNS_MAP.put("userName", Types.VARCHAR); TABLE_COLUMNS_MAP.put("createDate", Types.TIMESTAMP); TABLE_COLUMNS_MAP.put("modifiedDate", Types.TIMESTAMP); TABLE_COLUMNS_MAP.put("CPDefinitionId", Types.BIGINT); TABLE_COLUMNS_MAP.put("CPInstanceUuid", Types.VARCHAR); TABLE_COLUMNS_MAP.put("sku", Types.VARCHAR); TABLE_COLUMNS_MAP.put("gtin", Types.VARCHAR); TABLE_COLUMNS_MAP.put("manufacturerPartNumber", Types.VARCHAR); TABLE_COLUMNS_MAP.put("purchasable", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("width", Types.DOUBLE); TABLE_COLUMNS_MAP.put("height", Types.DOUBLE); TABLE_COLUMNS_MAP.put("depth", Types.DOUBLE); TABLE_COLUMNS_MAP.put("weight", Types.DOUBLE); TABLE_COLUMNS_MAP.put("price", Types.DECIMAL); TABLE_COLUMNS_MAP.put("promoPrice", Types.DECIMAL); TABLE_COLUMNS_MAP.put("cost", Types.DECIMAL); TABLE_COLUMNS_MAP.put("published", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("displayDate", Types.TIMESTAMP); TABLE_COLUMNS_MAP.put("expirationDate", Types.TIMESTAMP); TABLE_COLUMNS_MAP.put("lastPublishDate", Types.TIMESTAMP); TABLE_COLUMNS_MAP.put("overrideSubscriptionInfo", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("subscriptionEnabled", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("subscriptionLength", Types.INTEGER); TABLE_COLUMNS_MAP.put("subscriptionType", Types.VARCHAR); TABLE_COLUMNS_MAP.put("subscriptionTypeSettings", Types.CLOB); TABLE_COLUMNS_MAP.put("maxSubscriptionCycles", Types.BIGINT); TABLE_COLUMNS_MAP.put("deliverySubscriptionEnabled", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("deliverySubscriptionLength", Types.INTEGER); TABLE_COLUMNS_MAP.put("deliverySubscriptionType", Types.VARCHAR); TABLE_COLUMNS_MAP.put("deliverySubTypeSettings", Types.VARCHAR); TABLE_COLUMNS_MAP.put("deliveryMaxSubscriptionCycles", Types.BIGINT); TABLE_COLUMNS_MAP.put("unspsc", Types.VARCHAR); TABLE_COLUMNS_MAP.put("discontinued", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("discontinuedDate", Types.TIMESTAMP); TABLE_COLUMNS_MAP.put("replacementCPInstanceUuid", Types.VARCHAR); TABLE_COLUMNS_MAP.put("replacementCProductId", Types.BIGINT); TABLE_COLUMNS_MAP.put("status", Types.INTEGER); TABLE_COLUMNS_MAP.put("statusByUserId", Types.BIGINT); TABLE_COLUMNS_MAP.put("statusByUserName", Types.VARCHAR); TABLE_COLUMNS_MAP.put("statusDate", Types.TIMESTAMP); } public static final String TABLE_SQL_CREATE = "create table CPInstance (mvccVersion LONG default 0 not null,ctCollectionId LONG default 0 not null,uuid_ VARCHAR(75) null,externalReferenceCode VARCHAR(75) null,CPInstanceId LONG not null,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,CPDefinitionId LONG,CPInstanceUuid VARCHAR(75) null,sku VARCHAR(75) null,gtin VARCHAR(75) null,manufacturerPartNumber VARCHAR(75) null,purchasable BOOLEAN,width DOUBLE,height DOUBLE,depth DOUBLE,weight DOUBLE,price BIGDECIMAL null,promoPrice BIGDECIMAL null,cost BIGDECIMAL null,published BOOLEAN,displayDate DATE null,expirationDate DATE null,lastPublishDate DATE null,overrideSubscriptionInfo BOOLEAN,subscriptionEnabled BOOLEAN,subscriptionLength INTEGER,subscriptionType VARCHAR(75) null,subscriptionTypeSettings TEXT null,maxSubscriptionCycles LONG,deliverySubscriptionEnabled BOOLEAN,deliverySubscriptionLength INTEGER,deliverySubscriptionType VARCHAR(75) null,deliverySubTypeSettings VARCHAR(75) null,deliveryMaxSubscriptionCycles LONG,unspsc VARCHAR(75) null,discontinued BOOLEAN,discontinuedDate DATE null,replacementCPInstanceUuid VARCHAR(75) null,replacementCProductId LONG,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null,primary key (CPInstanceId, ctCollectionId))"; public static final String TABLE_SQL_DROP = "drop table CPInstance"; public static final String ORDER_BY_JPQL = " ORDER BY cpInstance.displayDate DESC, cpInstance.createDate DESC"; public static final String ORDER_BY_SQL = " ORDER BY CPInstance.displayDate DESC, CPInstance.createDate DESC"; public static final String ORDER_BY_SQL_INLINE_DISTINCT = " ORDER BY cpInstance.displayDate DESC, cpInstance.createDate DESC"; public static final String DATA_SOURCE = "liferayDataSource"; public static final String SESSION_FACTORY = "liferaySessionFactory"; public static final String TX_MANAGER = "liferayTransactionManager"; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long CPDEFINITIONID_COLUMN_BITMASK = 1L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long CPINSTANCEUUID_COLUMN_BITMASK = 2L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long COMPANYID_COLUMN_BITMASK = 4L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long DISPLAYDATE_COLUMN_BITMASK = 8L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long EXTERNALREFERENCECODE_COLUMN_BITMASK = 16L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long GROUPID_COLUMN_BITMASK = 32L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long REPLACEMENTCPINSTANCEUUID_COLUMN_BITMASK = 64L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long REPLACEMENTCPRODUCTID_COLUMN_BITMASK = 128L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long SKU_COLUMN_BITMASK = 256L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long STATUS_COLUMN_BITMASK = 512L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long UUID_COLUMN_BITMASK = 1024L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnBitmask(String)} */ @Deprecated public static final long CREATEDATE_COLUMN_BITMASK = 2048L; /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static void setEntityCacheEnabled(boolean entityCacheEnabled) { } /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static void setFinderCacheEnabled(boolean finderCacheEnabled) { } public CPInstanceModelImpl() { } @Override public long getPrimaryKey() { return _CPInstanceId; } @Override public void setPrimaryKey(long primaryKey) { setCPInstanceId(primaryKey); } @Override public Serializable getPrimaryKeyObj() { return _CPInstanceId; } @Override public void setPrimaryKeyObj(Serializable primaryKeyObj) { setPrimaryKey(((Long)primaryKeyObj).longValue()); } @Override public Class getModelClass() { return CPInstance.class; } @Override public String getModelClassName() { return CPInstance.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((CPInstance)this)); } 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( (CPInstance)this, entry.getValue()); } } } public Map> getAttributeGetterFunctions() { return AttributeGetterFunctionsHolder._attributeGetterFunctions; } public Map> getAttributeSetterBiConsumers() { return AttributeSetterBiConsumersHolder._attributeSetterBiConsumers; } private static class AttributeGetterFunctionsHolder { private static final Map> _attributeGetterFunctions; static { Map> attributeGetterFunctions = new LinkedHashMap>(); attributeGetterFunctions.put( "mvccVersion", CPInstance::getMvccVersion); attributeGetterFunctions.put( "ctCollectionId", CPInstance::getCtCollectionId); attributeGetterFunctions.put("uuid", CPInstance::getUuid); attributeGetterFunctions.put( "externalReferenceCode", CPInstance::getExternalReferenceCode); attributeGetterFunctions.put( "CPInstanceId", CPInstance::getCPInstanceId); attributeGetterFunctions.put("groupId", CPInstance::getGroupId); attributeGetterFunctions.put("companyId", CPInstance::getCompanyId); attributeGetterFunctions.put("userId", CPInstance::getUserId); attributeGetterFunctions.put("userName", CPInstance::getUserName); attributeGetterFunctions.put( "createDate", CPInstance::getCreateDate); attributeGetterFunctions.put( "modifiedDate", CPInstance::getModifiedDate); attributeGetterFunctions.put( "CPDefinitionId", CPInstance::getCPDefinitionId); attributeGetterFunctions.put( "CPInstanceUuid", CPInstance::getCPInstanceUuid); attributeGetterFunctions.put("sku", CPInstance::getSku); attributeGetterFunctions.put("gtin", CPInstance::getGtin); attributeGetterFunctions.put( "manufacturerPartNumber", CPInstance::getManufacturerPartNumber); attributeGetterFunctions.put( "purchasable", CPInstance::getPurchasable); attributeGetterFunctions.put("width", CPInstance::getWidth); attributeGetterFunctions.put("height", CPInstance::getHeight); attributeGetterFunctions.put("depth", CPInstance::getDepth); attributeGetterFunctions.put("weight", CPInstance::getWeight); attributeGetterFunctions.put("price", CPInstance::getPrice); attributeGetterFunctions.put( "promoPrice", CPInstance::getPromoPrice); attributeGetterFunctions.put("cost", CPInstance::getCost); attributeGetterFunctions.put("published", CPInstance::getPublished); attributeGetterFunctions.put( "displayDate", CPInstance::getDisplayDate); attributeGetterFunctions.put( "expirationDate", CPInstance::getExpirationDate); attributeGetterFunctions.put( "lastPublishDate", CPInstance::getLastPublishDate); attributeGetterFunctions.put( "overrideSubscriptionInfo", CPInstance::getOverrideSubscriptionInfo); attributeGetterFunctions.put( "subscriptionEnabled", CPInstance::getSubscriptionEnabled); attributeGetterFunctions.put( "subscriptionLength", CPInstance::getSubscriptionLength); attributeGetterFunctions.put( "subscriptionType", CPInstance::getSubscriptionType); attributeGetterFunctions.put( "subscriptionTypeSettings", CPInstance::getSubscriptionTypeSettings); attributeGetterFunctions.put( "maxSubscriptionCycles", CPInstance::getMaxSubscriptionCycles); attributeGetterFunctions.put( "deliverySubscriptionEnabled", CPInstance::getDeliverySubscriptionEnabled); attributeGetterFunctions.put( "deliverySubscriptionLength", CPInstance::getDeliverySubscriptionLength); attributeGetterFunctions.put( "deliverySubscriptionType", CPInstance::getDeliverySubscriptionType); attributeGetterFunctions.put( "deliverySubscriptionTypeSettings", CPInstance::getDeliverySubscriptionTypeSettings); attributeGetterFunctions.put( "deliveryMaxSubscriptionCycles", CPInstance::getDeliveryMaxSubscriptionCycles); attributeGetterFunctions.put("unspsc", CPInstance::getUnspsc); attributeGetterFunctions.put( "discontinued", CPInstance::getDiscontinued); attributeGetterFunctions.put( "discontinuedDate", CPInstance::getDiscontinuedDate); attributeGetterFunctions.put( "replacementCPInstanceUuid", CPInstance::getReplacementCPInstanceUuid); attributeGetterFunctions.put( "replacementCProductId", CPInstance::getReplacementCProductId); attributeGetterFunctions.put("status", CPInstance::getStatus); attributeGetterFunctions.put( "statusByUserId", CPInstance::getStatusByUserId); attributeGetterFunctions.put( "statusByUserName", CPInstance::getStatusByUserName); attributeGetterFunctions.put( "statusDate", CPInstance::getStatusDate); _attributeGetterFunctions = Collections.unmodifiableMap( attributeGetterFunctions); } } private static class AttributeSetterBiConsumersHolder { private static final Map> _attributeSetterBiConsumers; static { Map> attributeSetterBiConsumers = new LinkedHashMap>(); attributeSetterBiConsumers.put( "mvccVersion", (BiConsumer)CPInstance::setMvccVersion); attributeSetterBiConsumers.put( "ctCollectionId", (BiConsumer)CPInstance::setCtCollectionId); attributeSetterBiConsumers.put( "uuid", (BiConsumer)CPInstance::setUuid); attributeSetterBiConsumers.put( "externalReferenceCode", (BiConsumer) CPInstance::setExternalReferenceCode); attributeSetterBiConsumers.put( "CPInstanceId", (BiConsumer)CPInstance::setCPInstanceId); attributeSetterBiConsumers.put( "groupId", (BiConsumer)CPInstance::setGroupId); attributeSetterBiConsumers.put( "companyId", (BiConsumer)CPInstance::setCompanyId); attributeSetterBiConsumers.put( "userId", (BiConsumer)CPInstance::setUserId); attributeSetterBiConsumers.put( "userName", (BiConsumer)CPInstance::setUserName); attributeSetterBiConsumers.put( "createDate", (BiConsumer)CPInstance::setCreateDate); attributeSetterBiConsumers.put( "modifiedDate", (BiConsumer)CPInstance::setModifiedDate); attributeSetterBiConsumers.put( "CPDefinitionId", (BiConsumer)CPInstance::setCPDefinitionId); attributeSetterBiConsumers.put( "CPInstanceUuid", (BiConsumer)CPInstance::setCPInstanceUuid); attributeSetterBiConsumers.put( "sku", (BiConsumer)CPInstance::setSku); attributeSetterBiConsumers.put( "gtin", (BiConsumer)CPInstance::setGtin); attributeSetterBiConsumers.put( "manufacturerPartNumber", (BiConsumer) CPInstance::setManufacturerPartNumber); attributeSetterBiConsumers.put( "purchasable", (BiConsumer)CPInstance::setPurchasable); attributeSetterBiConsumers.put( "width", (BiConsumer)CPInstance::setWidth); attributeSetterBiConsumers.put( "height", (BiConsumer)CPInstance::setHeight); attributeSetterBiConsumers.put( "depth", (BiConsumer)CPInstance::setDepth); attributeSetterBiConsumers.put( "weight", (BiConsumer)CPInstance::setWeight); attributeSetterBiConsumers.put( "price", (BiConsumer)CPInstance::setPrice); attributeSetterBiConsumers.put( "promoPrice", (BiConsumer)CPInstance::setPromoPrice); attributeSetterBiConsumers.put( "cost", (BiConsumer)CPInstance::setCost); attributeSetterBiConsumers.put( "published", (BiConsumer)CPInstance::setPublished); attributeSetterBiConsumers.put( "displayDate", (BiConsumer)CPInstance::setDisplayDate); attributeSetterBiConsumers.put( "expirationDate", (BiConsumer)CPInstance::setExpirationDate); attributeSetterBiConsumers.put( "lastPublishDate", (BiConsumer)CPInstance::setLastPublishDate); attributeSetterBiConsumers.put( "overrideSubscriptionInfo", (BiConsumer) CPInstance::setOverrideSubscriptionInfo); attributeSetterBiConsumers.put( "subscriptionEnabled", (BiConsumer) CPInstance::setSubscriptionEnabled); attributeSetterBiConsumers.put( "subscriptionLength", (BiConsumer) CPInstance::setSubscriptionLength); attributeSetterBiConsumers.put( "subscriptionType", (BiConsumer) CPInstance::setSubscriptionType); attributeSetterBiConsumers.put( "subscriptionTypeSettings", (BiConsumer) CPInstance::setSubscriptionTypeSettings); attributeSetterBiConsumers.put( "maxSubscriptionCycles", (BiConsumer) CPInstance::setMaxSubscriptionCycles); attributeSetterBiConsumers.put( "deliverySubscriptionEnabled", (BiConsumer) CPInstance::setDeliverySubscriptionEnabled); attributeSetterBiConsumers.put( "deliverySubscriptionLength", (BiConsumer) CPInstance::setDeliverySubscriptionLength); attributeSetterBiConsumers.put( "deliverySubscriptionType", (BiConsumer) CPInstance::setDeliverySubscriptionType); attributeSetterBiConsumers.put( "deliverySubscriptionTypeSettings", (BiConsumer) CPInstance::setDeliverySubscriptionTypeSettings); attributeSetterBiConsumers.put( "deliveryMaxSubscriptionCycles", (BiConsumer) CPInstance::setDeliveryMaxSubscriptionCycles); attributeSetterBiConsumers.put( "unspsc", (BiConsumer)CPInstance::setUnspsc); attributeSetterBiConsumers.put( "discontinued", (BiConsumer)CPInstance::setDiscontinued); attributeSetterBiConsumers.put( "discontinuedDate", (BiConsumer)CPInstance::setDiscontinuedDate); attributeSetterBiConsumers.put( "replacementCPInstanceUuid", (BiConsumer) CPInstance::setReplacementCPInstanceUuid); attributeSetterBiConsumers.put( "replacementCProductId", (BiConsumer) CPInstance::setReplacementCProductId); attributeSetterBiConsumers.put( "status", (BiConsumer)CPInstance::setStatus); attributeSetterBiConsumers.put( "statusByUserId", (BiConsumer)CPInstance::setStatusByUserId); attributeSetterBiConsumers.put( "statusByUserName", (BiConsumer) CPInstance::setStatusByUserName); attributeSetterBiConsumers.put( "statusDate", (BiConsumer)CPInstance::setStatusDate); _attributeSetterBiConsumers = Collections.unmodifiableMap( (Map)attributeSetterBiConsumers); } } @JSON @Override public long getMvccVersion() { return _mvccVersion; } @Override public void setMvccVersion(long mvccVersion) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _mvccVersion = mvccVersion; } @JSON @Override public long getCtCollectionId() { return _ctCollectionId; } @Override public void setCtCollectionId(long ctCollectionId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _ctCollectionId = ctCollectionId; } @JSON @Override public String getUuid() { if (_uuid == null) { return ""; } else { return _uuid; } } @Override public void setUuid(String uuid) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _uuid = uuid; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalUuid() { return getColumnOriginalValue("uuid_"); } @JSON @Override public String getExternalReferenceCode() { if (_externalReferenceCode == null) { return ""; } else { return _externalReferenceCode; } } @Override public void setExternalReferenceCode(String externalReferenceCode) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _externalReferenceCode = externalReferenceCode; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalExternalReferenceCode() { return getColumnOriginalValue("externalReferenceCode"); } @JSON @Override public long getCPInstanceId() { return _CPInstanceId; } @Override public void setCPInstanceId(long CPInstanceId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _CPInstanceId = CPInstanceId; } @JSON @Override public long getGroupId() { return _groupId; } @Override public void setGroupId(long groupId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _groupId = groupId; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public long getOriginalGroupId() { return GetterUtil.getLong(this.getColumnOriginalValue("groupId")); } @JSON @Override public long getCompanyId() { return _companyId; } @Override public void setCompanyId(long companyId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _companyId = companyId; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public long getOriginalCompanyId() { return GetterUtil.getLong( this.getColumnOriginalValue("companyId")); } @JSON @Override public long getUserId() { return _userId; } @Override public void setUserId(long userId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _userId = userId; } @Override public String getUserUuid() { try { User user = UserLocalServiceUtil.getUserById(getUserId()); return user.getUuid(); } catch (PortalException portalException) { return ""; } } @Override public void setUserUuid(String userUuid) { } @JSON @Override public String getUserName() { if (_userName == null) { return ""; } else { return _userName; } } @Override public void setUserName(String userName) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _userName = userName; } @JSON @Override public Date getCreateDate() { return _createDate; } @Override public void setCreateDate(Date createDate) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _createDate = createDate; } @JSON @Override public Date getModifiedDate() { return _modifiedDate; } public boolean hasSetModifiedDate() { return _setModifiedDate; } @Override public void setModifiedDate(Date modifiedDate) { _setModifiedDate = true; if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _modifiedDate = modifiedDate; } @JSON @Override public long getCPDefinitionId() { return _CPDefinitionId; } @Override public void setCPDefinitionId(long CPDefinitionId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _CPDefinitionId = CPDefinitionId; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public long getOriginalCPDefinitionId() { return GetterUtil.getLong( this.getColumnOriginalValue("CPDefinitionId")); } @JSON @Override public String getCPInstanceUuid() { if (_CPInstanceUuid == null) { return ""; } else { return _CPInstanceUuid; } } @Override public void setCPInstanceUuid(String CPInstanceUuid) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _CPInstanceUuid = CPInstanceUuid; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalCPInstanceUuid() { return getColumnOriginalValue("CPInstanceUuid"); } @JSON @Override public String getSku() { if (_sku == null) { return ""; } else { return _sku; } } @Override public void setSku(String sku) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _sku = sku; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalSku() { return getColumnOriginalValue("sku"); } @JSON @Override public String getGtin() { if (_gtin == null) { return ""; } else { return _gtin; } } @Override public void setGtin(String gtin) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _gtin = gtin; } @JSON @Override public String getManufacturerPartNumber() { if (_manufacturerPartNumber == null) { return ""; } else { return _manufacturerPartNumber; } } @Override public void setManufacturerPartNumber(String manufacturerPartNumber) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _manufacturerPartNumber = manufacturerPartNumber; } @JSON @Override public boolean getPurchasable() { return _purchasable; } @JSON @Override public boolean isPurchasable() { return _purchasable; } @Override public void setPurchasable(boolean purchasable) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _purchasable = purchasable; } @JSON @Override public double getWidth() { return _width; } @Override public void setWidth(double width) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _width = width; } @JSON @Override public double getHeight() { return _height; } @Override public void setHeight(double height) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _height = height; } @JSON @Override public double getDepth() { return _depth; } @Override public void setDepth(double depth) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _depth = depth; } @JSON @Override public double getWeight() { return _weight; } @Override public void setWeight(double weight) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _weight = weight; } @JSON @Override public BigDecimal getPrice() { return _price; } @Override public void setPrice(BigDecimal price) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _price = price; } @JSON @Override public BigDecimal getPromoPrice() { return _promoPrice; } @Override public void setPromoPrice(BigDecimal promoPrice) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _promoPrice = promoPrice; } @JSON @Override public BigDecimal getCost() { return _cost; } @Override public void setCost(BigDecimal cost) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _cost = cost; } @JSON @Override public boolean getPublished() { return _published; } @JSON @Override public boolean isPublished() { return _published; } @Override public void setPublished(boolean published) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _published = published; } @JSON @Override public Date getDisplayDate() { return _displayDate; } @Override public void setDisplayDate(Date displayDate) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _displayDate = displayDate; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public Date getOriginalDisplayDate() { return getColumnOriginalValue("displayDate"); } @JSON @Override public Date getExpirationDate() { return _expirationDate; } @Override public void setExpirationDate(Date expirationDate) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _expirationDate = expirationDate; } @JSON @Override public Date getLastPublishDate() { return _lastPublishDate; } @Override public void setLastPublishDate(Date lastPublishDate) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _lastPublishDate = lastPublishDate; } @JSON @Override public boolean getOverrideSubscriptionInfo() { return _overrideSubscriptionInfo; } @JSON @Override public boolean isOverrideSubscriptionInfo() { return _overrideSubscriptionInfo; } @Override public void setOverrideSubscriptionInfo(boolean overrideSubscriptionInfo) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _overrideSubscriptionInfo = overrideSubscriptionInfo; } @JSON @Override public boolean getSubscriptionEnabled() { return _subscriptionEnabled; } @JSON @Override public boolean isSubscriptionEnabled() { return _subscriptionEnabled; } @Override public void setSubscriptionEnabled(boolean subscriptionEnabled) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _subscriptionEnabled = subscriptionEnabled; } @JSON @Override public int getSubscriptionLength() { return _subscriptionLength; } @Override public void setSubscriptionLength(int subscriptionLength) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _subscriptionLength = subscriptionLength; } @JSON @Override public String getSubscriptionType() { if (_subscriptionType == null) { return ""; } else { return _subscriptionType; } } @Override public void setSubscriptionType(String subscriptionType) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _subscriptionType = subscriptionType; } @JSON @Override public String getSubscriptionTypeSettings() { if (_subscriptionTypeSettings == null) { return ""; } else { return _subscriptionTypeSettings; } } @Override public void setSubscriptionTypeSettings(String subscriptionTypeSettings) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _subscriptionTypeSettings = subscriptionTypeSettings; } @JSON @Override public long getMaxSubscriptionCycles() { return _maxSubscriptionCycles; } @Override public void setMaxSubscriptionCycles(long maxSubscriptionCycles) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _maxSubscriptionCycles = maxSubscriptionCycles; } @JSON @Override public boolean getDeliverySubscriptionEnabled() { return _deliverySubscriptionEnabled; } @JSON @Override public boolean isDeliverySubscriptionEnabled() { return _deliverySubscriptionEnabled; } @Override public void setDeliverySubscriptionEnabled( boolean deliverySubscriptionEnabled) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _deliverySubscriptionEnabled = deliverySubscriptionEnabled; } @JSON @Override public int getDeliverySubscriptionLength() { return _deliverySubscriptionLength; } @Override public void setDeliverySubscriptionLength(int deliverySubscriptionLength) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _deliverySubscriptionLength = deliverySubscriptionLength; } @JSON @Override public String getDeliverySubscriptionType() { if (_deliverySubscriptionType == null) { return ""; } else { return _deliverySubscriptionType; } } @Override public void setDeliverySubscriptionType(String deliverySubscriptionType) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _deliverySubscriptionType = deliverySubscriptionType; } @JSON @Override public String getDeliverySubscriptionTypeSettings() { if (_deliverySubscriptionTypeSettings == null) { return ""; } else { return _deliverySubscriptionTypeSettings; } } @Override public void setDeliverySubscriptionTypeSettings( String deliverySubscriptionTypeSettings) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _deliverySubscriptionTypeSettings = deliverySubscriptionTypeSettings; } @JSON @Override public long getDeliveryMaxSubscriptionCycles() { return _deliveryMaxSubscriptionCycles; } @Override public void setDeliveryMaxSubscriptionCycles( long deliveryMaxSubscriptionCycles) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _deliveryMaxSubscriptionCycles = deliveryMaxSubscriptionCycles; } @JSON @Override public String getUnspsc() { if (_unspsc == null) { return ""; } else { return _unspsc; } } @Override public void setUnspsc(String unspsc) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _unspsc = unspsc; } @JSON @Override public boolean getDiscontinued() { return _discontinued; } @JSON @Override public boolean isDiscontinued() { return _discontinued; } @Override public void setDiscontinued(boolean discontinued) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _discontinued = discontinued; } @JSON @Override public Date getDiscontinuedDate() { return _discontinuedDate; } @Override public void setDiscontinuedDate(Date discontinuedDate) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _discontinuedDate = discontinuedDate; } @JSON @Override public String getReplacementCPInstanceUuid() { if (_replacementCPInstanceUuid == null) { return ""; } else { return _replacementCPInstanceUuid; } } @Override public void setReplacementCPInstanceUuid(String replacementCPInstanceUuid) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _replacementCPInstanceUuid = replacementCPInstanceUuid; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalReplacementCPInstanceUuid() { return getColumnOriginalValue("replacementCPInstanceUuid"); } @JSON @Override public long getReplacementCProductId() { return _replacementCProductId; } @Override public void setReplacementCProductId(long replacementCProductId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _replacementCProductId = replacementCProductId; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public long getOriginalReplacementCProductId() { return GetterUtil.getLong( this.getColumnOriginalValue("replacementCProductId")); } @JSON @Override public int getStatus() { return _status; } @Override public void setStatus(int status) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _status = status; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public int getOriginalStatus() { return GetterUtil.getInteger( this.getColumnOriginalValue("status")); } @JSON @Override public long getStatusByUserId() { return _statusByUserId; } @Override public void setStatusByUserId(long statusByUserId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _statusByUserId = statusByUserId; } @Override public String getStatusByUserUuid() { try { User user = UserLocalServiceUtil.getUserById(getStatusByUserId()); return user.getUuid(); } catch (PortalException portalException) { return ""; } } @Override public void setStatusByUserUuid(String statusByUserUuid) { } @JSON @Override public String getStatusByUserName() { if (_statusByUserName == null) { return ""; } else { return _statusByUserName; } } @Override public void setStatusByUserName(String statusByUserName) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _statusByUserName = statusByUserName; } @JSON @Override public Date getStatusDate() { return _statusDate; } @Override public void setStatusDate(Date statusDate) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _statusDate = statusDate; } @Override public StagedModelType getStagedModelType() { return new StagedModelType( PortalUtil.getClassNameId(CPInstance.class.getName())); } @Override public boolean isApproved() { if (getStatus() == WorkflowConstants.STATUS_APPROVED) { return true; } else { return false; } } @Override public boolean isDenied() { if (getStatus() == WorkflowConstants.STATUS_DENIED) { return true; } else { return false; } } @Override public boolean isDraft() { if (getStatus() == WorkflowConstants.STATUS_DRAFT) { return true; } else { return false; } } @Override public boolean isExpired() { if (getStatus() == WorkflowConstants.STATUS_EXPIRED) { return true; } else { return false; } } @Override public boolean isInactive() { if (getStatus() == WorkflowConstants.STATUS_INACTIVE) { return true; } else { return false; } } @Override public boolean isIncomplete() { if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) { return true; } else { return false; } } @Override public boolean isPending() { if (getStatus() == WorkflowConstants.STATUS_PENDING) { return true; } else { return false; } } @Override public boolean isScheduled() { if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) { return true; } else { return false; } } public long getColumnBitmask() { if (_columnBitmask > 0) { return _columnBitmask; } if ((_columnOriginalValues == null) || (_columnOriginalValues == Collections.EMPTY_MAP)) { return 0; } for (Map.Entry entry : _columnOriginalValues.entrySet()) { if (!Objects.equals( entry.getValue(), getColumnValue(entry.getKey()))) { _columnBitmask |= _columnBitmasks.get(entry.getKey()); } } return _columnBitmask; } @Override public ExpandoBridge getExpandoBridge() { return ExpandoBridgeFactoryUtil.getExpandoBridge( getCompanyId(), CPInstance.class.getName(), getPrimaryKey()); } @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext) { ExpandoBridge expandoBridge = getExpandoBridge(); expandoBridge.setAttributes(serviceContext); } @Override public CPInstance toEscapedModel() { if (_escapedModel == null) { Function escapedModelProxyProviderFunction = EscapedModelProxyProviderFunctionHolder. _escapedModelProxyProviderFunction; _escapedModel = escapedModelProxyProviderFunction.apply( new AutoEscapeBeanHandler(this)); } return _escapedModel; } @Override public Object clone() { CPInstanceImpl cpInstanceImpl = new CPInstanceImpl(); cpInstanceImpl.setMvccVersion(getMvccVersion()); cpInstanceImpl.setCtCollectionId(getCtCollectionId()); cpInstanceImpl.setUuid(getUuid()); cpInstanceImpl.setExternalReferenceCode(getExternalReferenceCode()); cpInstanceImpl.setCPInstanceId(getCPInstanceId()); cpInstanceImpl.setGroupId(getGroupId()); cpInstanceImpl.setCompanyId(getCompanyId()); cpInstanceImpl.setUserId(getUserId()); cpInstanceImpl.setUserName(getUserName()); cpInstanceImpl.setCreateDate(getCreateDate()); cpInstanceImpl.setModifiedDate(getModifiedDate()); cpInstanceImpl.setCPDefinitionId(getCPDefinitionId()); cpInstanceImpl.setCPInstanceUuid(getCPInstanceUuid()); cpInstanceImpl.setSku(getSku()); cpInstanceImpl.setGtin(getGtin()); cpInstanceImpl.setManufacturerPartNumber(getManufacturerPartNumber()); cpInstanceImpl.setPurchasable(isPurchasable()); cpInstanceImpl.setWidth(getWidth()); cpInstanceImpl.setHeight(getHeight()); cpInstanceImpl.setDepth(getDepth()); cpInstanceImpl.setWeight(getWeight()); cpInstanceImpl.setPrice(getPrice()); cpInstanceImpl.setPromoPrice(getPromoPrice()); cpInstanceImpl.setCost(getCost()); cpInstanceImpl.setPublished(isPublished()); cpInstanceImpl.setDisplayDate(getDisplayDate()); cpInstanceImpl.setExpirationDate(getExpirationDate()); cpInstanceImpl.setLastPublishDate(getLastPublishDate()); cpInstanceImpl.setOverrideSubscriptionInfo( isOverrideSubscriptionInfo()); cpInstanceImpl.setSubscriptionEnabled(isSubscriptionEnabled()); cpInstanceImpl.setSubscriptionLength(getSubscriptionLength()); cpInstanceImpl.setSubscriptionType(getSubscriptionType()); cpInstanceImpl.setSubscriptionTypeSettings( getSubscriptionTypeSettings()); cpInstanceImpl.setMaxSubscriptionCycles(getMaxSubscriptionCycles()); cpInstanceImpl.setDeliverySubscriptionEnabled( isDeliverySubscriptionEnabled()); cpInstanceImpl.setDeliverySubscriptionLength( getDeliverySubscriptionLength()); cpInstanceImpl.setDeliverySubscriptionType( getDeliverySubscriptionType()); cpInstanceImpl.setDeliverySubscriptionTypeSettings( getDeliverySubscriptionTypeSettings()); cpInstanceImpl.setDeliveryMaxSubscriptionCycles( getDeliveryMaxSubscriptionCycles()); cpInstanceImpl.setUnspsc(getUnspsc()); cpInstanceImpl.setDiscontinued(isDiscontinued()); cpInstanceImpl.setDiscontinuedDate(getDiscontinuedDate()); cpInstanceImpl.setReplacementCPInstanceUuid( getReplacementCPInstanceUuid()); cpInstanceImpl.setReplacementCProductId(getReplacementCProductId()); cpInstanceImpl.setStatus(getStatus()); cpInstanceImpl.setStatusByUserId(getStatusByUserId()); cpInstanceImpl.setStatusByUserName(getStatusByUserName()); cpInstanceImpl.setStatusDate(getStatusDate()); cpInstanceImpl.resetOriginalValues(); return cpInstanceImpl; } @Override public CPInstance cloneWithOriginalValues() { CPInstanceImpl cpInstanceImpl = new CPInstanceImpl(); cpInstanceImpl.setMvccVersion( this.getColumnOriginalValue("mvccVersion")); cpInstanceImpl.setCtCollectionId( this.getColumnOriginalValue("ctCollectionId")); cpInstanceImpl.setUuid(this.getColumnOriginalValue("uuid_")); cpInstanceImpl.setExternalReferenceCode( this.getColumnOriginalValue("externalReferenceCode")); cpInstanceImpl.setCPInstanceId( this.getColumnOriginalValue("CPInstanceId")); cpInstanceImpl.setGroupId(this.getColumnOriginalValue("groupId")); cpInstanceImpl.setCompanyId( this.getColumnOriginalValue("companyId")); cpInstanceImpl.setUserId(this.getColumnOriginalValue("userId")); cpInstanceImpl.setUserName( this.getColumnOriginalValue("userName")); cpInstanceImpl.setCreateDate( this.getColumnOriginalValue("createDate")); cpInstanceImpl.setModifiedDate( this.getColumnOriginalValue("modifiedDate")); cpInstanceImpl.setCPDefinitionId( this.getColumnOriginalValue("CPDefinitionId")); cpInstanceImpl.setCPInstanceUuid( this.getColumnOriginalValue("CPInstanceUuid")); cpInstanceImpl.setSku(this.getColumnOriginalValue("sku")); cpInstanceImpl.setGtin(this.getColumnOriginalValue("gtin")); cpInstanceImpl.setManufacturerPartNumber( this.getColumnOriginalValue("manufacturerPartNumber")); cpInstanceImpl.setPurchasable( this.getColumnOriginalValue("purchasable")); cpInstanceImpl.setWidth(this.getColumnOriginalValue("width")); cpInstanceImpl.setHeight(this.getColumnOriginalValue("height")); cpInstanceImpl.setDepth(this.getColumnOriginalValue("depth")); cpInstanceImpl.setWeight(this.getColumnOriginalValue("weight")); cpInstanceImpl.setPrice( this.getColumnOriginalValue("price")); cpInstanceImpl.setPromoPrice( this.getColumnOriginalValue("promoPrice")); cpInstanceImpl.setCost(this.getColumnOriginalValue("cost")); cpInstanceImpl.setPublished( this.getColumnOriginalValue("published")); cpInstanceImpl.setDisplayDate( this.getColumnOriginalValue("displayDate")); cpInstanceImpl.setExpirationDate( this.getColumnOriginalValue("expirationDate")); cpInstanceImpl.setLastPublishDate( this.getColumnOriginalValue("lastPublishDate")); cpInstanceImpl.setOverrideSubscriptionInfo( this.getColumnOriginalValue("overrideSubscriptionInfo")); cpInstanceImpl.setSubscriptionEnabled( this.getColumnOriginalValue("subscriptionEnabled")); cpInstanceImpl.setSubscriptionLength( this.getColumnOriginalValue("subscriptionLength")); cpInstanceImpl.setSubscriptionType( this.getColumnOriginalValue("subscriptionType")); cpInstanceImpl.setSubscriptionTypeSettings( this.getColumnOriginalValue("subscriptionTypeSettings")); cpInstanceImpl.setMaxSubscriptionCycles( this.getColumnOriginalValue("maxSubscriptionCycles")); cpInstanceImpl.setDeliverySubscriptionEnabled( this.getColumnOriginalValue( "deliverySubscriptionEnabled")); cpInstanceImpl.setDeliverySubscriptionLength( this.getColumnOriginalValue("deliverySubscriptionLength")); cpInstanceImpl.setDeliverySubscriptionType( this.getColumnOriginalValue("deliverySubscriptionType")); cpInstanceImpl.setDeliverySubscriptionTypeSettings( this.getColumnOriginalValue("deliverySubTypeSettings")); cpInstanceImpl.setDeliveryMaxSubscriptionCycles( this.getColumnOriginalValue("deliveryMaxSubscriptionCycles")); cpInstanceImpl.setUnspsc(this.getColumnOriginalValue("unspsc")); cpInstanceImpl.setDiscontinued( this.getColumnOriginalValue("discontinued")); cpInstanceImpl.setDiscontinuedDate( this.getColumnOriginalValue("discontinuedDate")); cpInstanceImpl.setReplacementCPInstanceUuid( this.getColumnOriginalValue("replacementCPInstanceUuid")); cpInstanceImpl.setReplacementCProductId( this.getColumnOriginalValue("replacementCProductId")); cpInstanceImpl.setStatus( this.getColumnOriginalValue("status")); cpInstanceImpl.setStatusByUserId( this.getColumnOriginalValue("statusByUserId")); cpInstanceImpl.setStatusByUserName( this.getColumnOriginalValue("statusByUserName")); cpInstanceImpl.setStatusDate( this.getColumnOriginalValue("statusDate")); return cpInstanceImpl; } @Override public int compareTo(CPInstance cpInstance) { int value = 0; value = DateUtil.compareTo( getDisplayDate(), cpInstance.getDisplayDate()); value = value * -1; if (value != 0) { return value; } value = DateUtil.compareTo(getCreateDate(), cpInstance.getCreateDate()); value = value * -1; if (value != 0) { return value; } return 0; } @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CPInstance)) { return false; } CPInstance cpInstance = (CPInstance)object; long primaryKey = cpInstance.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } } @Override public int hashCode() { return (int)getPrimaryKey(); } /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated @Override public boolean isEntityCacheEnabled() { return true; } /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated @Override public boolean isFinderCacheEnabled() { return true; } @Override public void resetOriginalValues() { _columnOriginalValues = Collections.emptyMap(); _setModifiedDate = false; _columnBitmask = 0; } @Override public CacheModel toCacheModel() { CPInstanceCacheModel cpInstanceCacheModel = new CPInstanceCacheModel(); cpInstanceCacheModel.mvccVersion = getMvccVersion(); cpInstanceCacheModel.ctCollectionId = getCtCollectionId(); cpInstanceCacheModel.uuid = getUuid(); String uuid = cpInstanceCacheModel.uuid; if ((uuid != null) && (uuid.length() == 0)) { cpInstanceCacheModel.uuid = null; } cpInstanceCacheModel.externalReferenceCode = getExternalReferenceCode(); String externalReferenceCode = cpInstanceCacheModel.externalReferenceCode; if ((externalReferenceCode != null) && (externalReferenceCode.length() == 0)) { cpInstanceCacheModel.externalReferenceCode = null; } cpInstanceCacheModel.CPInstanceId = getCPInstanceId(); cpInstanceCacheModel.groupId = getGroupId(); cpInstanceCacheModel.companyId = getCompanyId(); cpInstanceCacheModel.userId = getUserId(); cpInstanceCacheModel.userName = getUserName(); String userName = cpInstanceCacheModel.userName; if ((userName != null) && (userName.length() == 0)) { cpInstanceCacheModel.userName = null; } Date createDate = getCreateDate(); if (createDate != null) { cpInstanceCacheModel.createDate = createDate.getTime(); } else { cpInstanceCacheModel.createDate = Long.MIN_VALUE; } Date modifiedDate = getModifiedDate(); if (modifiedDate != null) { cpInstanceCacheModel.modifiedDate = modifiedDate.getTime(); } else { cpInstanceCacheModel.modifiedDate = Long.MIN_VALUE; } cpInstanceCacheModel.CPDefinitionId = getCPDefinitionId(); cpInstanceCacheModel.CPInstanceUuid = getCPInstanceUuid(); String CPInstanceUuid = cpInstanceCacheModel.CPInstanceUuid; if ((CPInstanceUuid != null) && (CPInstanceUuid.length() == 0)) { cpInstanceCacheModel.CPInstanceUuid = null; } cpInstanceCacheModel.sku = getSku(); String sku = cpInstanceCacheModel.sku; if ((sku != null) && (sku.length() == 0)) { cpInstanceCacheModel.sku = null; } cpInstanceCacheModel.gtin = getGtin(); String gtin = cpInstanceCacheModel.gtin; if ((gtin != null) && (gtin.length() == 0)) { cpInstanceCacheModel.gtin = null; } cpInstanceCacheModel.manufacturerPartNumber = getManufacturerPartNumber(); String manufacturerPartNumber = cpInstanceCacheModel.manufacturerPartNumber; if ((manufacturerPartNumber != null) && (manufacturerPartNumber.length() == 0)) { cpInstanceCacheModel.manufacturerPartNumber = null; } cpInstanceCacheModel.purchasable = isPurchasable(); cpInstanceCacheModel.width = getWidth(); cpInstanceCacheModel.height = getHeight(); cpInstanceCacheModel.depth = getDepth(); cpInstanceCacheModel.weight = getWeight(); cpInstanceCacheModel.price = getPrice(); cpInstanceCacheModel.promoPrice = getPromoPrice(); cpInstanceCacheModel.cost = getCost(); cpInstanceCacheModel.published = isPublished(); Date displayDate = getDisplayDate(); if (displayDate != null) { cpInstanceCacheModel.displayDate = displayDate.getTime(); } else { cpInstanceCacheModel.displayDate = Long.MIN_VALUE; } Date expirationDate = getExpirationDate(); if (expirationDate != null) { cpInstanceCacheModel.expirationDate = expirationDate.getTime(); } else { cpInstanceCacheModel.expirationDate = Long.MIN_VALUE; } Date lastPublishDate = getLastPublishDate(); if (lastPublishDate != null) { cpInstanceCacheModel.lastPublishDate = lastPublishDate.getTime(); } else { cpInstanceCacheModel.lastPublishDate = Long.MIN_VALUE; } cpInstanceCacheModel.overrideSubscriptionInfo = isOverrideSubscriptionInfo(); cpInstanceCacheModel.subscriptionEnabled = isSubscriptionEnabled(); cpInstanceCacheModel.subscriptionLength = getSubscriptionLength(); cpInstanceCacheModel.subscriptionType = getSubscriptionType(); String subscriptionType = cpInstanceCacheModel.subscriptionType; if ((subscriptionType != null) && (subscriptionType.length() == 0)) { cpInstanceCacheModel.subscriptionType = null; } cpInstanceCacheModel.subscriptionTypeSettings = getSubscriptionTypeSettings(); String subscriptionTypeSettings = cpInstanceCacheModel.subscriptionTypeSettings; if ((subscriptionTypeSettings != null) && (subscriptionTypeSettings.length() == 0)) { cpInstanceCacheModel.subscriptionTypeSettings = null; } cpInstanceCacheModel.maxSubscriptionCycles = getMaxSubscriptionCycles(); cpInstanceCacheModel.deliverySubscriptionEnabled = isDeliverySubscriptionEnabled(); cpInstanceCacheModel.deliverySubscriptionLength = getDeliverySubscriptionLength(); cpInstanceCacheModel.deliverySubscriptionType = getDeliverySubscriptionType(); String deliverySubscriptionType = cpInstanceCacheModel.deliverySubscriptionType; if ((deliverySubscriptionType != null) && (deliverySubscriptionType.length() == 0)) { cpInstanceCacheModel.deliverySubscriptionType = null; } cpInstanceCacheModel.deliverySubscriptionTypeSettings = getDeliverySubscriptionTypeSettings(); String deliverySubscriptionTypeSettings = cpInstanceCacheModel.deliverySubscriptionTypeSettings; if ((deliverySubscriptionTypeSettings != null) && (deliverySubscriptionTypeSettings.length() == 0)) { cpInstanceCacheModel.deliverySubscriptionTypeSettings = null; } cpInstanceCacheModel.deliveryMaxSubscriptionCycles = getDeliveryMaxSubscriptionCycles(); cpInstanceCacheModel.unspsc = getUnspsc(); String unspsc = cpInstanceCacheModel.unspsc; if ((unspsc != null) && (unspsc.length() == 0)) { cpInstanceCacheModel.unspsc = null; } cpInstanceCacheModel.discontinued = isDiscontinued(); Date discontinuedDate = getDiscontinuedDate(); if (discontinuedDate != null) { cpInstanceCacheModel.discontinuedDate = discontinuedDate.getTime(); } else { cpInstanceCacheModel.discontinuedDate = Long.MIN_VALUE; } cpInstanceCacheModel.replacementCPInstanceUuid = getReplacementCPInstanceUuid(); String replacementCPInstanceUuid = cpInstanceCacheModel.replacementCPInstanceUuid; if ((replacementCPInstanceUuid != null) && (replacementCPInstanceUuid.length() == 0)) { cpInstanceCacheModel.replacementCPInstanceUuid = null; } cpInstanceCacheModel.replacementCProductId = getReplacementCProductId(); cpInstanceCacheModel.status = getStatus(); cpInstanceCacheModel.statusByUserId = getStatusByUserId(); cpInstanceCacheModel.statusByUserName = getStatusByUserName(); String statusByUserName = cpInstanceCacheModel.statusByUserName; if ((statusByUserName != null) && (statusByUserName.length() == 0)) { cpInstanceCacheModel.statusByUserName = null; } Date statusDate = getStatusDate(); if (statusDate != null) { cpInstanceCacheModel.statusDate = statusDate.getTime(); } else { cpInstanceCacheModel.statusDate = Long.MIN_VALUE; } return cpInstanceCacheModel; } @Override public String toString() { Map> attributeGetterFunctions = getAttributeGetterFunctions(); StringBundler sb = new StringBundler( (5 * attributeGetterFunctions.size()) + 2); sb.append("{"); for (Map.Entry> entry : attributeGetterFunctions.entrySet()) { String attributeName = entry.getKey(); Function attributeGetterFunction = entry.getValue(); sb.append("\""); sb.append(attributeName); sb.append("\": "); Object value = attributeGetterFunction.apply((CPInstance)this); if (value == null) { sb.append("null"); } else if (value instanceof Blob || value instanceof Date || value instanceof Map || value instanceof String) { sb.append( "\"" + StringUtil.replace(value.toString(), "\"", "'") + "\""); } else { sb.append(value); } sb.append(", "); } if (sb.index() > 1) { sb.setIndex(sb.index() - 1); } sb.append("}"); return sb.toString(); } private static class EscapedModelProxyProviderFunctionHolder { private static final Function _escapedModelProxyProviderFunction = ProxyUtil.getProxyProviderFunction( CPInstance.class, ModelWrapper.class); } private long _mvccVersion; private long _ctCollectionId; private String _uuid; private String _externalReferenceCode; private long _CPInstanceId; private long _groupId; private long _companyId; private long _userId; private String _userName; private Date _createDate; private Date _modifiedDate; private boolean _setModifiedDate; private long _CPDefinitionId; private String _CPInstanceUuid; private String _sku; private String _gtin; private String _manufacturerPartNumber; private boolean _purchasable; private double _width; private double _height; private double _depth; private double _weight; private BigDecimal _price; private BigDecimal _promoPrice; private BigDecimal _cost; private boolean _published; private Date _displayDate; private Date _expirationDate; private Date _lastPublishDate; private boolean _overrideSubscriptionInfo; private boolean _subscriptionEnabled; private int _subscriptionLength; private String _subscriptionType; private String _subscriptionTypeSettings; private long _maxSubscriptionCycles; private boolean _deliverySubscriptionEnabled; private int _deliverySubscriptionLength; private String _deliverySubscriptionType; private String _deliverySubscriptionTypeSettings; private long _deliveryMaxSubscriptionCycles; private String _unspsc; private boolean _discontinued; private Date _discontinuedDate; private String _replacementCPInstanceUuid; private long _replacementCProductId; private int _status; private long _statusByUserId; private String _statusByUserName; private Date _statusDate; public T getColumnValue(String columnName) { columnName = _attributeNames.getOrDefault(columnName, columnName); Function function = AttributeGetterFunctionsHolder._attributeGetterFunctions.get( columnName); if (function == null) { throw new IllegalArgumentException( "No attribute getter function found for " + columnName); } return (T)function.apply((CPInstance)this); } public T getColumnOriginalValue(String columnName) { if (_columnOriginalValues == null) { return null; } if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } return (T)_columnOriginalValues.get(columnName); } private void _setColumnOriginalValues() { _columnOriginalValues = new HashMap(); _columnOriginalValues.put("mvccVersion", _mvccVersion); _columnOriginalValues.put("ctCollectionId", _ctCollectionId); _columnOriginalValues.put("uuid_", _uuid); _columnOriginalValues.put( "externalReferenceCode", _externalReferenceCode); _columnOriginalValues.put("CPInstanceId", _CPInstanceId); _columnOriginalValues.put("groupId", _groupId); _columnOriginalValues.put("companyId", _companyId); _columnOriginalValues.put("userId", _userId); _columnOriginalValues.put("userName", _userName); _columnOriginalValues.put("createDate", _createDate); _columnOriginalValues.put("modifiedDate", _modifiedDate); _columnOriginalValues.put("CPDefinitionId", _CPDefinitionId); _columnOriginalValues.put("CPInstanceUuid", _CPInstanceUuid); _columnOriginalValues.put("sku", _sku); _columnOriginalValues.put("gtin", _gtin); _columnOriginalValues.put( "manufacturerPartNumber", _manufacturerPartNumber); _columnOriginalValues.put("purchasable", _purchasable); _columnOriginalValues.put("width", _width); _columnOriginalValues.put("height", _height); _columnOriginalValues.put("depth", _depth); _columnOriginalValues.put("weight", _weight); _columnOriginalValues.put("price", _price); _columnOriginalValues.put("promoPrice", _promoPrice); _columnOriginalValues.put("cost", _cost); _columnOriginalValues.put("published", _published); _columnOriginalValues.put("displayDate", _displayDate); _columnOriginalValues.put("expirationDate", _expirationDate); _columnOriginalValues.put("lastPublishDate", _lastPublishDate); _columnOriginalValues.put( "overrideSubscriptionInfo", _overrideSubscriptionInfo); _columnOriginalValues.put("subscriptionEnabled", _subscriptionEnabled); _columnOriginalValues.put("subscriptionLength", _subscriptionLength); _columnOriginalValues.put("subscriptionType", _subscriptionType); _columnOriginalValues.put( "subscriptionTypeSettings", _subscriptionTypeSettings); _columnOriginalValues.put( "maxSubscriptionCycles", _maxSubscriptionCycles); _columnOriginalValues.put( "deliverySubscriptionEnabled", _deliverySubscriptionEnabled); _columnOriginalValues.put( "deliverySubscriptionLength", _deliverySubscriptionLength); _columnOriginalValues.put( "deliverySubscriptionType", _deliverySubscriptionType); _columnOriginalValues.put( "deliverySubTypeSettings", _deliverySubscriptionTypeSettings); _columnOriginalValues.put( "deliveryMaxSubscriptionCycles", _deliveryMaxSubscriptionCycles); _columnOriginalValues.put("unspsc", _unspsc); _columnOriginalValues.put("discontinued", _discontinued); _columnOriginalValues.put("discontinuedDate", _discontinuedDate); _columnOriginalValues.put( "replacementCPInstanceUuid", _replacementCPInstanceUuid); _columnOriginalValues.put( "replacementCProductId", _replacementCProductId); _columnOriginalValues.put("status", _status); _columnOriginalValues.put("statusByUserId", _statusByUserId); _columnOriginalValues.put("statusByUserName", _statusByUserName); _columnOriginalValues.put("statusDate", _statusDate); } private static final Map _attributeNames; static { Map attributeNames = new HashMap<>(); attributeNames.put("uuid_", "uuid"); attributeNames.put( "deliverySubTypeSettings", "deliverySubscriptionTypeSettings"); _attributeNames = Collections.unmodifiableMap(attributeNames); } private transient Map _columnOriginalValues; public static long getColumnBitmask(String columnName) { return _columnBitmasks.get(columnName); } private static final Map _columnBitmasks; static { Map columnBitmasks = new HashMap<>(); columnBitmasks.put("mvccVersion", 1L); columnBitmasks.put("ctCollectionId", 2L); columnBitmasks.put("uuid_", 4L); columnBitmasks.put("externalReferenceCode", 8L); columnBitmasks.put("CPInstanceId", 16L); columnBitmasks.put("groupId", 32L); columnBitmasks.put("companyId", 64L); columnBitmasks.put("userId", 128L); columnBitmasks.put("userName", 256L); columnBitmasks.put("createDate", 512L); columnBitmasks.put("modifiedDate", 1024L); columnBitmasks.put("CPDefinitionId", 2048L); columnBitmasks.put("CPInstanceUuid", 4096L); columnBitmasks.put("sku", 8192L); columnBitmasks.put("gtin", 16384L); columnBitmasks.put("manufacturerPartNumber", 32768L); columnBitmasks.put("purchasable", 65536L); columnBitmasks.put("width", 131072L); columnBitmasks.put("height", 262144L); columnBitmasks.put("depth", 524288L); columnBitmasks.put("weight", 1048576L); columnBitmasks.put("price", 2097152L); columnBitmasks.put("promoPrice", 4194304L); columnBitmasks.put("cost", 8388608L); columnBitmasks.put("published", 16777216L); columnBitmasks.put("displayDate", 33554432L); columnBitmasks.put("expirationDate", 67108864L); columnBitmasks.put("lastPublishDate", 134217728L); columnBitmasks.put("overrideSubscriptionInfo", 268435456L); columnBitmasks.put("subscriptionEnabled", 536870912L); columnBitmasks.put("subscriptionLength", 1073741824L); columnBitmasks.put("subscriptionType", 2147483648L); columnBitmasks.put("subscriptionTypeSettings", 4294967296L); columnBitmasks.put("maxSubscriptionCycles", 8589934592L); columnBitmasks.put("deliverySubscriptionEnabled", 17179869184L); columnBitmasks.put("deliverySubscriptionLength", 34359738368L); columnBitmasks.put("deliverySubscriptionType", 68719476736L); columnBitmasks.put("deliverySubTypeSettings", 137438953472L); columnBitmasks.put("deliveryMaxSubscriptionCycles", 274877906944L); columnBitmasks.put("unspsc", 549755813888L); columnBitmasks.put("discontinued", 1099511627776L); columnBitmasks.put("discontinuedDate", 2199023255552L); columnBitmasks.put("replacementCPInstanceUuid", 4398046511104L); columnBitmasks.put("replacementCProductId", 8796093022208L); columnBitmasks.put("status", 17592186044416L); columnBitmasks.put("statusByUserId", 35184372088832L); columnBitmasks.put("statusByUserName", 70368744177664L); columnBitmasks.put("statusDate", 140737488355328L); _columnBitmasks = Collections.unmodifiableMap(columnBitmasks); } private long _columnBitmask; private CPInstance _escapedModel; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy