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

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

There is a newer version: 6.0.152
Show newest version
/**
 * 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.commerce.product.model.impl;

import com.liferay.commerce.product.model.CPInstance;
import com.liferay.commerce.product.model.CPInstanceModel;
import com.liferay.commerce.product.model.CPInstanceSoap;
import com.liferay.expando.kernel.model.ExpandoBridge;
import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
import com.liferay.exportimport.kernel.lar.StagedModelType;
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.StringBundler;
import com.liferay.portal.kernel.workflow.WorkflowConstants;

import java.io.Serializable;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;

import java.math.BigDecimal;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
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 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 = { {"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}, {"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("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("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 (uuid_ VARCHAR(75) null,externalReferenceCode VARCHAR(75) null,CPInstanceId LONG not null primary key,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 DECIMAL(30, 16) null,promoPrice DECIMAL(30, 16) null,cost DECIMAL(30, 16) 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,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)"; 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 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.commerce.product.service.util.ServiceProps.get( "value.object.entity.cache.enabled.com.liferay.commerce.product.model.CPInstance"), true); public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean( com.liferay.commerce.product.service.util.ServiceProps.get( "value.object.finder.cache.enabled.com.liferay.commerce.product.model.CPInstance"), true); public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean( com.liferay.commerce.product.service.util.ServiceProps.get( "value.object.column.bitmask.enabled.com.liferay.commerce.product.model.CPInstance"), true); public static final long CPDEFINITIONID_COLUMN_BITMASK = 1L; public static final long CPINSTANCEUUID_COLUMN_BITMASK = 2L; public static final long COMPANYID_COLUMN_BITMASK = 4L; public static final long DISPLAYDATE_COLUMN_BITMASK = 8L; public static final long EXTERNALREFERENCECODE_COLUMN_BITMASK = 16L; public static final long GROUPID_COLUMN_BITMASK = 32L; public static final long SKU_COLUMN_BITMASK = 64L; public static final long STATUS_COLUMN_BITMASK = 128L; public static final long UUID_COLUMN_BITMASK = 256L; public static final long CREATEDATE_COLUMN_BITMASK = 512L; /** * 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 CPInstance toModel(CPInstanceSoap soapModel) { if (soapModel == null) { return null; } CPInstance model = new CPInstanceImpl(); model.setUuid(soapModel.getUuid()); model.setExternalReferenceCode(soapModel.getExternalReferenceCode()); model.setCPInstanceId(soapModel.getCPInstanceId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); model.setCPDefinitionId(soapModel.getCPDefinitionId()); model.setCPInstanceUuid(soapModel.getCPInstanceUuid()); model.setSku(soapModel.getSku()); model.setGtin(soapModel.getGtin()); model.setManufacturerPartNumber(soapModel.getManufacturerPartNumber()); model.setPurchasable(soapModel.isPurchasable()); model.setWidth(soapModel.getWidth()); model.setHeight(soapModel.getHeight()); model.setDepth(soapModel.getDepth()); model.setWeight(soapModel.getWeight()); model.setPrice(soapModel.getPrice()); model.setPromoPrice(soapModel.getPromoPrice()); model.setCost(soapModel.getCost()); model.setPublished(soapModel.isPublished()); model.setDisplayDate(soapModel.getDisplayDate()); model.setExpirationDate(soapModel.getExpirationDate()); model.setLastPublishDate(soapModel.getLastPublishDate()); model.setOverrideSubscriptionInfo( soapModel.isOverrideSubscriptionInfo()); model.setSubscriptionEnabled(soapModel.isSubscriptionEnabled()); model.setSubscriptionLength(soapModel.getSubscriptionLength()); model.setSubscriptionType(soapModel.getSubscriptionType()); model.setSubscriptionTypeSettings( soapModel.getSubscriptionTypeSettings()); model.setMaxSubscriptionCycles(soapModel.getMaxSubscriptionCycles()); model.setDeliverySubscriptionEnabled( soapModel.isDeliverySubscriptionEnabled()); model.setDeliverySubscriptionLength( soapModel.getDeliverySubscriptionLength()); model.setDeliverySubscriptionType( soapModel.getDeliverySubscriptionType()); model.setDeliverySubscriptionTypeSettings( soapModel.getDeliverySubscriptionTypeSettings()); model.setDeliveryMaxSubscriptionCycles( soapModel.getDeliveryMaxSubscriptionCycles()); model.setUnspsc(soapModel.getUnspsc()); model.setStatus(soapModel.getStatus()); model.setStatusByUserId(soapModel.getStatusByUserId()); model.setStatusByUserName(soapModel.getStatusByUserName()); model.setStatusDate(soapModel.getStatusDate()); 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(CPInstanceSoap[] soapModels) { if (soapModels == null) { return null; } List models = new ArrayList(soapModels.length); for (CPInstanceSoap soapModel : soapModels) { models.add(toModel(soapModel)); } return models; } public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong( com.liferay.commerce.product.service.util.ServiceProps.get( "lock.expiration.time.com.liferay.commerce.product.model.CPInstance")); 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)); } 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( (CPInstance)this, entry.getValue()); } } } public Map> getAttributeGetterFunctions() { return _attributeGetterFunctions; } public Map> getAttributeSetterBiConsumers() { return _attributeSetterBiConsumers; } private static Function _getProxyProviderFunction() { Class proxyClass = ProxyUtil.getProxyClass( CPInstance.class.getClassLoader(), CPInstance.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( "uuid", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getUuid(); } }); attributeSetterBiConsumers.put( "uuid", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object uuidObject) { cpInstance.setUuid((String)uuidObject); } }); attributeGetterFunctions.put( "externalReferenceCode", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getExternalReferenceCode(); } }); attributeSetterBiConsumers.put( "externalReferenceCode", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object externalReferenceCodeObject) { cpInstance.setExternalReferenceCode( (String)externalReferenceCodeObject); } }); attributeGetterFunctions.put( "CPInstanceId", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getCPInstanceId(); } }); attributeSetterBiConsumers.put( "CPInstanceId", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object CPInstanceIdObject) { cpInstance.setCPInstanceId((Long)CPInstanceIdObject); } }); attributeGetterFunctions.put( "groupId", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getGroupId(); } }); attributeSetterBiConsumers.put( "groupId", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object groupIdObject) { cpInstance.setGroupId((Long)groupIdObject); } }); attributeGetterFunctions.put( "companyId", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getCompanyId(); } }); attributeSetterBiConsumers.put( "companyId", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object companyIdObject) { cpInstance.setCompanyId((Long)companyIdObject); } }); attributeGetterFunctions.put( "userId", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getUserId(); } }); attributeSetterBiConsumers.put( "userId", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object userIdObject) { cpInstance.setUserId((Long)userIdObject); } }); attributeGetterFunctions.put( "userName", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getUserName(); } }); attributeSetterBiConsumers.put( "userName", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object userNameObject) { cpInstance.setUserName((String)userNameObject); } }); attributeGetterFunctions.put( "createDate", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getCreateDate(); } }); attributeSetterBiConsumers.put( "createDate", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object createDateObject) { cpInstance.setCreateDate((Date)createDateObject); } }); attributeGetterFunctions.put( "modifiedDate", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getModifiedDate(); } }); attributeSetterBiConsumers.put( "modifiedDate", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object modifiedDateObject) { cpInstance.setModifiedDate((Date)modifiedDateObject); } }); attributeGetterFunctions.put( "CPDefinitionId", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getCPDefinitionId(); } }); attributeSetterBiConsumers.put( "CPDefinitionId", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object CPDefinitionIdObject) { cpInstance.setCPDefinitionId((Long)CPDefinitionIdObject); } }); attributeGetterFunctions.put( "CPInstanceUuid", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getCPInstanceUuid(); } }); attributeSetterBiConsumers.put( "CPInstanceUuid", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object CPInstanceUuidObject) { cpInstance.setCPInstanceUuid((String)CPInstanceUuidObject); } }); attributeGetterFunctions.put( "sku", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getSku(); } }); attributeSetterBiConsumers.put( "sku", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object skuObject) { cpInstance.setSku((String)skuObject); } }); attributeGetterFunctions.put( "gtin", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getGtin(); } }); attributeSetterBiConsumers.put( "gtin", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object gtinObject) { cpInstance.setGtin((String)gtinObject); } }); attributeGetterFunctions.put( "manufacturerPartNumber", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getManufacturerPartNumber(); } }); attributeSetterBiConsumers.put( "manufacturerPartNumber", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object manufacturerPartNumberObject) { cpInstance.setManufacturerPartNumber( (String)manufacturerPartNumberObject); } }); attributeGetterFunctions.put( "purchasable", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getPurchasable(); } }); attributeSetterBiConsumers.put( "purchasable", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object purchasableObject) { cpInstance.setPurchasable((Boolean)purchasableObject); } }); attributeGetterFunctions.put( "width", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getWidth(); } }); attributeSetterBiConsumers.put( "width", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object widthObject) { cpInstance.setWidth((Double)widthObject); } }); attributeGetterFunctions.put( "height", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getHeight(); } }); attributeSetterBiConsumers.put( "height", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object heightObject) { cpInstance.setHeight((Double)heightObject); } }); attributeGetterFunctions.put( "depth", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getDepth(); } }); attributeSetterBiConsumers.put( "depth", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object depthObject) { cpInstance.setDepth((Double)depthObject); } }); attributeGetterFunctions.put( "weight", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getWeight(); } }); attributeSetterBiConsumers.put( "weight", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object weightObject) { cpInstance.setWeight((Double)weightObject); } }); attributeGetterFunctions.put( "price", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getPrice(); } }); attributeSetterBiConsumers.put( "price", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object priceObject) { cpInstance.setPrice((BigDecimal)priceObject); } }); attributeGetterFunctions.put( "promoPrice", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getPromoPrice(); } }); attributeSetterBiConsumers.put( "promoPrice", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object promoPriceObject) { cpInstance.setPromoPrice((BigDecimal)promoPriceObject); } }); attributeGetterFunctions.put( "cost", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getCost(); } }); attributeSetterBiConsumers.put( "cost", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object costObject) { cpInstance.setCost((BigDecimal)costObject); } }); attributeGetterFunctions.put( "published", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getPublished(); } }); attributeSetterBiConsumers.put( "published", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object publishedObject) { cpInstance.setPublished((Boolean)publishedObject); } }); attributeGetterFunctions.put( "displayDate", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getDisplayDate(); } }); attributeSetterBiConsumers.put( "displayDate", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object displayDateObject) { cpInstance.setDisplayDate((Date)displayDateObject); } }); attributeGetterFunctions.put( "expirationDate", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getExpirationDate(); } }); attributeSetterBiConsumers.put( "expirationDate", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object expirationDateObject) { cpInstance.setExpirationDate((Date)expirationDateObject); } }); attributeGetterFunctions.put( "lastPublishDate", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getLastPublishDate(); } }); attributeSetterBiConsumers.put( "lastPublishDate", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object lastPublishDateObject) { cpInstance.setLastPublishDate((Date)lastPublishDateObject); } }); attributeGetterFunctions.put( "overrideSubscriptionInfo", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getOverrideSubscriptionInfo(); } }); attributeSetterBiConsumers.put( "overrideSubscriptionInfo", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object overrideSubscriptionInfoObject) { cpInstance.setOverrideSubscriptionInfo( (Boolean)overrideSubscriptionInfoObject); } }); attributeGetterFunctions.put( "subscriptionEnabled", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getSubscriptionEnabled(); } }); attributeSetterBiConsumers.put( "subscriptionEnabled", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object subscriptionEnabledObject) { cpInstance.setSubscriptionEnabled( (Boolean)subscriptionEnabledObject); } }); attributeGetterFunctions.put( "subscriptionLength", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getSubscriptionLength(); } }); attributeSetterBiConsumers.put( "subscriptionLength", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object subscriptionLengthObject) { cpInstance.setSubscriptionLength( (Integer)subscriptionLengthObject); } }); attributeGetterFunctions.put( "subscriptionType", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getSubscriptionType(); } }); attributeSetterBiConsumers.put( "subscriptionType", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object subscriptionTypeObject) { cpInstance.setSubscriptionType( (String)subscriptionTypeObject); } }); attributeGetterFunctions.put( "subscriptionTypeSettings", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getSubscriptionTypeSettings(); } }); attributeSetterBiConsumers.put( "subscriptionTypeSettings", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object subscriptionTypeSettingsObject) { cpInstance.setSubscriptionTypeSettings( (String)subscriptionTypeSettingsObject); } }); attributeGetterFunctions.put( "maxSubscriptionCycles", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getMaxSubscriptionCycles(); } }); attributeSetterBiConsumers.put( "maxSubscriptionCycles", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object maxSubscriptionCyclesObject) { cpInstance.setMaxSubscriptionCycles( (Long)maxSubscriptionCyclesObject); } }); attributeGetterFunctions.put( "deliverySubscriptionEnabled", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getDeliverySubscriptionEnabled(); } }); attributeSetterBiConsumers.put( "deliverySubscriptionEnabled", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object deliverySubscriptionEnabledObject) { cpInstance.setDeliverySubscriptionEnabled( (Boolean)deliverySubscriptionEnabledObject); } }); attributeGetterFunctions.put( "deliverySubscriptionLength", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getDeliverySubscriptionLength(); } }); attributeSetterBiConsumers.put( "deliverySubscriptionLength", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object deliverySubscriptionLengthObject) { cpInstance.setDeliverySubscriptionLength( (Integer)deliverySubscriptionLengthObject); } }); attributeGetterFunctions.put( "deliverySubscriptionType", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getDeliverySubscriptionType(); } }); attributeSetterBiConsumers.put( "deliverySubscriptionType", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object deliverySubscriptionTypeObject) { cpInstance.setDeliverySubscriptionType( (String)deliverySubscriptionTypeObject); } }); attributeGetterFunctions.put( "deliverySubscriptionTypeSettings", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getDeliverySubscriptionTypeSettings(); } }); attributeSetterBiConsumers.put( "deliverySubscriptionTypeSettings", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object deliverySubscriptionTypeSettingsObject) { cpInstance.setDeliverySubscriptionTypeSettings( (String)deliverySubscriptionTypeSettingsObject); } }); attributeGetterFunctions.put( "deliveryMaxSubscriptionCycles", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getDeliveryMaxSubscriptionCycles(); } }); attributeSetterBiConsumers.put( "deliveryMaxSubscriptionCycles", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object deliveryMaxSubscriptionCyclesObject) { cpInstance.setDeliveryMaxSubscriptionCycles( (Long)deliveryMaxSubscriptionCyclesObject); } }); attributeGetterFunctions.put( "unspsc", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getUnspsc(); } }); attributeSetterBiConsumers.put( "unspsc", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object unspscObject) { cpInstance.setUnspsc((String)unspscObject); } }); attributeGetterFunctions.put( "status", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getStatus(); } }); attributeSetterBiConsumers.put( "status", new BiConsumer() { @Override public void accept(CPInstance cpInstance, Object statusObject) { cpInstance.setStatus((Integer)statusObject); } }); attributeGetterFunctions.put( "statusByUserId", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getStatusByUserId(); } }); attributeSetterBiConsumers.put( "statusByUserId", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object statusByUserIdObject) { cpInstance.setStatusByUserId((Long)statusByUserIdObject); } }); attributeGetterFunctions.put( "statusByUserName", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getStatusByUserName(); } }); attributeSetterBiConsumers.put( "statusByUserName", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object statusByUserNameObject) { cpInstance.setStatusByUserName( (String)statusByUserNameObject); } }); attributeGetterFunctions.put( "statusDate", new Function() { @Override public Object apply(CPInstance cpInstance) { return cpInstance.getStatusDate(); } }); attributeSetterBiConsumers.put( "statusDate", new BiConsumer() { @Override public void accept( CPInstance cpInstance, Object statusDateObject) { cpInstance.setStatusDate((Date)statusDateObject); } }); _attributeGetterFunctions = Collections.unmodifiableMap( attributeGetterFunctions); _attributeSetterBiConsumers = Collections.unmodifiableMap( (Map)attributeSetterBiConsumers); } @JSON @Override public String getUuid() { if (_uuid == null) { return ""; } else { return _uuid; } } @Override public void setUuid(String uuid) { _columnBitmask |= UUID_COLUMN_BITMASK; if (_originalUuid == null) { _originalUuid = _uuid; } _uuid = uuid; } public String getOriginalUuid() { return GetterUtil.getString(_originalUuid); } @JSON @Override public String getExternalReferenceCode() { if (_externalReferenceCode == null) { return ""; } else { return _externalReferenceCode; } } @Override public void setExternalReferenceCode(String externalReferenceCode) { _columnBitmask |= EXTERNALREFERENCECODE_COLUMN_BITMASK; if (_originalExternalReferenceCode == null) { _originalExternalReferenceCode = _externalReferenceCode; } _externalReferenceCode = externalReferenceCode; } public String getOriginalExternalReferenceCode() { return GetterUtil.getString(_originalExternalReferenceCode); } @JSON @Override public long getCPInstanceId() { return _CPInstanceId; } @Override public void setCPInstanceId(long CPInstanceId) { _CPInstanceId = CPInstanceId; } @JSON @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; } @JSON @Override public long getCompanyId() { return _companyId; } @Override public void setCompanyId(long companyId) { _columnBitmask |= COMPANYID_COLUMN_BITMASK; if (!_setOriginalCompanyId) { _setOriginalCompanyId = true; _originalCompanyId = _companyId; } _companyId = companyId; } public long getOriginalCompanyId() { return _originalCompanyId; } @JSON @Override public long getUserId() { return _userId; } @Override public void setUserId(long userId) { _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) { _userName = userName; } @JSON @Override public Date getCreateDate() { return _createDate; } @Override public void setCreateDate(Date createDate) { _columnBitmask = -1L; _createDate = createDate; } @JSON @Override public Date getModifiedDate() { return _modifiedDate; } public boolean hasSetModifiedDate() { return _setModifiedDate; } @Override public void setModifiedDate(Date modifiedDate) { _setModifiedDate = true; _modifiedDate = modifiedDate; } @JSON @Override public long getCPDefinitionId() { return _CPDefinitionId; } @Override public void setCPDefinitionId(long CPDefinitionId) { _columnBitmask |= CPDEFINITIONID_COLUMN_BITMASK; if (!_setOriginalCPDefinitionId) { _setOriginalCPDefinitionId = true; _originalCPDefinitionId = _CPDefinitionId; } _CPDefinitionId = CPDefinitionId; } public long getOriginalCPDefinitionId() { return _originalCPDefinitionId; } @JSON @Override public String getCPInstanceUuid() { if (_CPInstanceUuid == null) { return ""; } else { return _CPInstanceUuid; } } @Override public void setCPInstanceUuid(String CPInstanceUuid) { _columnBitmask |= CPINSTANCEUUID_COLUMN_BITMASK; if (_originalCPInstanceUuid == null) { _originalCPInstanceUuid = _CPInstanceUuid; } _CPInstanceUuid = CPInstanceUuid; } public String getOriginalCPInstanceUuid() { return GetterUtil.getString(_originalCPInstanceUuid); } @JSON @Override public String getSku() { if (_sku == null) { return ""; } else { return _sku; } } @Override public void setSku(String sku) { _columnBitmask |= SKU_COLUMN_BITMASK; if (_originalSku == null) { _originalSku = _sku; } _sku = sku; } public String getOriginalSku() { return GetterUtil.getString(_originalSku); } @JSON @Override public String getGtin() { if (_gtin == null) { return ""; } else { return _gtin; } } @Override public void setGtin(String gtin) { _gtin = gtin; } @JSON @Override public String getManufacturerPartNumber() { if (_manufacturerPartNumber == null) { return ""; } else { return _manufacturerPartNumber; } } @Override public void setManufacturerPartNumber(String manufacturerPartNumber) { _manufacturerPartNumber = manufacturerPartNumber; } @JSON @Override public boolean getPurchasable() { return _purchasable; } @JSON @Override public boolean isPurchasable() { return _purchasable; } @Override public void setPurchasable(boolean purchasable) { _purchasable = purchasable; } @JSON @Override public double getWidth() { return _width; } @Override public void setWidth(double width) { _width = width; } @JSON @Override public double getHeight() { return _height; } @Override public void setHeight(double height) { _height = height; } @JSON @Override public double getDepth() { return _depth; } @Override public void setDepth(double depth) { _depth = depth; } @JSON @Override public double getWeight() { return _weight; } @Override public void setWeight(double weight) { _weight = weight; } @JSON @Override public BigDecimal getPrice() { return _price; } @Override public void setPrice(BigDecimal price) { _price = price; } @JSON @Override public BigDecimal getPromoPrice() { return _promoPrice; } @Override public void setPromoPrice(BigDecimal promoPrice) { _promoPrice = promoPrice; } @JSON @Override public BigDecimal getCost() { return _cost; } @Override public void setCost(BigDecimal cost) { _cost = cost; } @JSON @Override public boolean getPublished() { return _published; } @JSON @Override public boolean isPublished() { return _published; } @Override public void setPublished(boolean published) { _published = published; } @JSON @Override public Date getDisplayDate() { return _displayDate; } @Override public void setDisplayDate(Date displayDate) { _columnBitmask = -1L; if (_originalDisplayDate == null) { _originalDisplayDate = _displayDate; } _displayDate = displayDate; } public Date getOriginalDisplayDate() { return _originalDisplayDate; } @JSON @Override public Date getExpirationDate() { return _expirationDate; } @Override public void setExpirationDate(Date expirationDate) { _expirationDate = expirationDate; } @JSON @Override public Date getLastPublishDate() { return _lastPublishDate; } @Override public void setLastPublishDate(Date lastPublishDate) { _lastPublishDate = lastPublishDate; } @JSON @Override public boolean getOverrideSubscriptionInfo() { return _overrideSubscriptionInfo; } @JSON @Override public boolean isOverrideSubscriptionInfo() { return _overrideSubscriptionInfo; } @Override public void setOverrideSubscriptionInfo(boolean overrideSubscriptionInfo) { _overrideSubscriptionInfo = overrideSubscriptionInfo; } @JSON @Override public boolean getSubscriptionEnabled() { return _subscriptionEnabled; } @JSON @Override public boolean isSubscriptionEnabled() { return _subscriptionEnabled; } @Override public void setSubscriptionEnabled(boolean subscriptionEnabled) { _subscriptionEnabled = subscriptionEnabled; } @JSON @Override public int getSubscriptionLength() { return _subscriptionLength; } @Override public void setSubscriptionLength(int subscriptionLength) { _subscriptionLength = subscriptionLength; } @JSON @Override public String getSubscriptionType() { if (_subscriptionType == null) { return ""; } else { return _subscriptionType; } } @Override public void setSubscriptionType(String subscriptionType) { _subscriptionType = subscriptionType; } @JSON @Override public String getSubscriptionTypeSettings() { if (_subscriptionTypeSettings == null) { return ""; } else { return _subscriptionTypeSettings; } } @Override public void setSubscriptionTypeSettings(String subscriptionTypeSettings) { _subscriptionTypeSettings = subscriptionTypeSettings; } @JSON @Override public long getMaxSubscriptionCycles() { return _maxSubscriptionCycles; } @Override public void setMaxSubscriptionCycles(long maxSubscriptionCycles) { _maxSubscriptionCycles = maxSubscriptionCycles; } @JSON @Override public boolean getDeliverySubscriptionEnabled() { return _deliverySubscriptionEnabled; } @JSON @Override public boolean isDeliverySubscriptionEnabled() { return _deliverySubscriptionEnabled; } @Override public void setDeliverySubscriptionEnabled( boolean deliverySubscriptionEnabled) { _deliverySubscriptionEnabled = deliverySubscriptionEnabled; } @JSON @Override public int getDeliverySubscriptionLength() { return _deliverySubscriptionLength; } @Override public void setDeliverySubscriptionLength(int deliverySubscriptionLength) { _deliverySubscriptionLength = deliverySubscriptionLength; } @JSON @Override public String getDeliverySubscriptionType() { if (_deliverySubscriptionType == null) { return ""; } else { return _deliverySubscriptionType; } } @Override public void setDeliverySubscriptionType(String deliverySubscriptionType) { _deliverySubscriptionType = deliverySubscriptionType; } @JSON @Override public String getDeliverySubscriptionTypeSettings() { if (_deliverySubscriptionTypeSettings == null) { return ""; } else { return _deliverySubscriptionTypeSettings; } } @Override public void setDeliverySubscriptionTypeSettings( String deliverySubscriptionTypeSettings) { _deliverySubscriptionTypeSettings = deliverySubscriptionTypeSettings; } @JSON @Override public long getDeliveryMaxSubscriptionCycles() { return _deliveryMaxSubscriptionCycles; } @Override public void setDeliveryMaxSubscriptionCycles( long deliveryMaxSubscriptionCycles) { _deliveryMaxSubscriptionCycles = deliveryMaxSubscriptionCycles; } @JSON @Override public String getUnspsc() { if (_unspsc == null) { return ""; } else { return _unspsc; } } @Override public void setUnspsc(String unspsc) { _unspsc = unspsc; } @JSON @Override public int getStatus() { return _status; } @Override public void setStatus(int status) { _columnBitmask |= STATUS_COLUMN_BITMASK; if (!_setOriginalStatus) { _setOriginalStatus = true; _originalStatus = _status; } _status = status; } public int getOriginalStatus() { return _originalStatus; } @JSON @Override public long getStatusByUserId() { return _statusByUserId; } @Override public void setStatusByUserId(long statusByUserId) { _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) { _statusByUserName = statusByUserName; } @JSON @Override public Date getStatusDate() { return _statusDate; } @Override public void setStatusDate(Date statusDate) { _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() { 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.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.setStatus(getStatus()); cpInstanceImpl.setStatusByUserId(getStatusByUserId()); cpInstanceImpl.setStatusByUserName(getStatusByUserName()); cpInstanceImpl.setStatusDate(getStatusDate()); cpInstanceImpl.resetOriginalValues(); 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(); } @Override public boolean isEntityCacheEnabled() { return ENTITY_CACHE_ENABLED; } @Override public boolean isFinderCacheEnabled() { return FINDER_CACHE_ENABLED; } @Override public void resetOriginalValues() { CPInstanceModelImpl cpInstanceModelImpl = this; cpInstanceModelImpl._originalUuid = cpInstanceModelImpl._uuid; cpInstanceModelImpl._originalExternalReferenceCode = cpInstanceModelImpl._externalReferenceCode; cpInstanceModelImpl._originalGroupId = cpInstanceModelImpl._groupId; cpInstanceModelImpl._setOriginalGroupId = false; cpInstanceModelImpl._originalCompanyId = cpInstanceModelImpl._companyId; cpInstanceModelImpl._setOriginalCompanyId = false; cpInstanceModelImpl._setModifiedDate = false; cpInstanceModelImpl._originalCPDefinitionId = cpInstanceModelImpl._CPDefinitionId; cpInstanceModelImpl._setOriginalCPDefinitionId = false; cpInstanceModelImpl._originalCPInstanceUuid = cpInstanceModelImpl._CPInstanceUuid; cpInstanceModelImpl._originalSku = cpInstanceModelImpl._sku; cpInstanceModelImpl._originalDisplayDate = cpInstanceModelImpl._displayDate; cpInstanceModelImpl._originalStatus = cpInstanceModelImpl._status; cpInstanceModelImpl._setOriginalStatus = false; cpInstanceModelImpl._columnBitmask = 0; } @Override public CacheModel toCacheModel() { CPInstanceCacheModel cpInstanceCacheModel = new CPInstanceCacheModel(); 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.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( 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((CPInstance)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 String _uuid; private String _originalUuid; private String _externalReferenceCode; private String _originalExternalReferenceCode; private long _CPInstanceId; private long _groupId; private long _originalGroupId; private boolean _setOriginalGroupId; private long _companyId; private long _originalCompanyId; private boolean _setOriginalCompanyId; private long _userId; private String _userName; private Date _createDate; private Date _modifiedDate; private boolean _setModifiedDate; private long _CPDefinitionId; private long _originalCPDefinitionId; private boolean _setOriginalCPDefinitionId; private String _CPInstanceUuid; private String _originalCPInstanceUuid; private String _sku; private String _originalSku; 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 _originalDisplayDate; 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 int _status; private int _originalStatus; private boolean _setOriginalStatus; private long _statusByUserId; private String _statusByUserName; private Date _statusDate; private long _columnBitmask; private CPInstance _escapedModel; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy