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

com.liferay.commerce.model.impl.CPDefinitionInventoryModelImpl Maven / Gradle / Ivy

There is a newer version: 11.0.188
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.model.impl;

import com.liferay.commerce.model.CPDefinitionInventory;
import com.liferay.commerce.model.CPDefinitionInventoryModel;
import com.liferay.commerce.model.CPDefinitionInventorySoap;
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.GetterUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.util.ProxyUtil;

import java.io.Serializable;

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

import java.sql.Types;

import java.util.ArrayList;
import java.util.Collections;
import java.util.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 CPDefinitionInventory service. Represents a row in the "CPDefinitionInventory" database table, with each column mapped to a property of this class.
 *
 * 

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

* * @author Alessio Antonio Rendina * @see CPDefinitionInventoryImpl * @generated */ @JSON(strict = true) public class CPDefinitionInventoryModelImpl extends BaseModelImpl implements CPDefinitionInventoryModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a cp definition inventory model instance should use the CPDefinitionInventory interface instead. */ public static final String TABLE_NAME = "CPDefinitionInventory"; public static final Object[][] TABLE_COLUMNS = { {"uuid_", Types.VARCHAR}, {"CPDefinitionInventoryId", Types.BIGINT}, {"groupId", Types.BIGINT}, {"companyId", Types.BIGINT}, {"userId", Types.BIGINT}, {"userName", Types.VARCHAR}, {"createDate", Types.TIMESTAMP}, {"modifiedDate", Types.TIMESTAMP}, {"CPDefinitionId", Types.BIGINT}, {"CPDefinitionInventoryEngine", Types.VARCHAR}, {"lowStockActivity", Types.VARCHAR}, {"displayAvailability", Types.BOOLEAN}, {"displayStockQuantity", Types.BOOLEAN}, {"minStockQuantity", Types.INTEGER}, {"backOrders", Types.BOOLEAN}, {"minOrderQuantity", Types.INTEGER}, {"maxOrderQuantity", Types.INTEGER}, {"allowedOrderQuantities", Types.VARCHAR}, {"multipleOrderQuantity", Types.INTEGER} }; public static final Map TABLE_COLUMNS_MAP = new HashMap(); static { TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR); TABLE_COLUMNS_MAP.put("CPDefinitionInventoryId", 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("CPDefinitionInventoryEngine", Types.VARCHAR); TABLE_COLUMNS_MAP.put("lowStockActivity", Types.VARCHAR); TABLE_COLUMNS_MAP.put("displayAvailability", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("displayStockQuantity", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("minStockQuantity", Types.INTEGER); TABLE_COLUMNS_MAP.put("backOrders", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("minOrderQuantity", Types.INTEGER); TABLE_COLUMNS_MAP.put("maxOrderQuantity", Types.INTEGER); TABLE_COLUMNS_MAP.put("allowedOrderQuantities", Types.VARCHAR); TABLE_COLUMNS_MAP.put("multipleOrderQuantity", Types.INTEGER); } public static final String TABLE_SQL_CREATE = "create table CPDefinitionInventory (uuid_ VARCHAR(75) null,CPDefinitionInventoryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,CPDefinitionId LONG,CPDefinitionInventoryEngine VARCHAR(75) null,lowStockActivity VARCHAR(75) null,displayAvailability BOOLEAN,displayStockQuantity BOOLEAN,minStockQuantity INTEGER,backOrders BOOLEAN,minOrderQuantity INTEGER,maxOrderQuantity INTEGER,allowedOrderQuantities VARCHAR(75) null,multipleOrderQuantity INTEGER)"; public static final String TABLE_SQL_DROP = "drop table CPDefinitionInventory"; public static final String ORDER_BY_JPQL = " ORDER BY cpDefinitionInventory.CPDefinitionInventoryId ASC"; public static final String ORDER_BY_SQL = " ORDER BY CPDefinitionInventory.CPDefinitionInventoryId ASC"; 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), with no direct replacement */ @Deprecated public static final boolean ENTITY_CACHE_ENABLED = true; /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static final boolean FINDER_CACHE_ENABLED = true; /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static final boolean COLUMN_BITMASK_ENABLED = true; /** * @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 COMPANYID_COLUMN_BITMASK = 2L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String) */ @Deprecated public static final long GROUPID_COLUMN_BITMASK = 4L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String) */ @Deprecated public static final long UUID_COLUMN_BITMASK = 8L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnBitmask(String) */ @Deprecated public static final long CPDEFINITIONINVENTORYID_COLUMN_BITMASK = 16L; /** * Converts the soap model instance into a normal model instance. * * @param soapModel the soap model instance to convert * @return the normal model instance * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static CPDefinitionInventory toModel( CPDefinitionInventorySoap soapModel) { if (soapModel == null) { return null; } CPDefinitionInventory model = new CPDefinitionInventoryImpl(); model.setUuid(soapModel.getUuid()); model.setCPDefinitionInventoryId( soapModel.getCPDefinitionInventoryId()); 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.setCPDefinitionInventoryEngine( soapModel.getCPDefinitionInventoryEngine()); model.setLowStockActivity(soapModel.getLowStockActivity()); model.setDisplayAvailability(soapModel.isDisplayAvailability()); model.setDisplayStockQuantity(soapModel.isDisplayStockQuantity()); model.setMinStockQuantity(soapModel.getMinStockQuantity()); model.setBackOrders(soapModel.isBackOrders()); model.setMinOrderQuantity(soapModel.getMinOrderQuantity()); model.setMaxOrderQuantity(soapModel.getMaxOrderQuantity()); model.setAllowedOrderQuantities(soapModel.getAllowedOrderQuantities()); model.setMultipleOrderQuantity(soapModel.getMultipleOrderQuantity()); return model; } /** * Converts the soap model instances into normal model instances. * * @param soapModels the soap model instances to convert * @return the normal model instances * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static List toModels( CPDefinitionInventorySoap[] soapModels) { if (soapModels == null) { return null; } List models = new ArrayList(soapModels.length); for (CPDefinitionInventorySoap soapModel : soapModels) { models.add(toModel(soapModel)); } return models; } public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong( com.liferay.commerce.service.util.ServiceProps.get( "lock.expiration.time.com.liferay.commerce.model.CPDefinitionInventory")); public CPDefinitionInventoryModelImpl() { } @Override public long getPrimaryKey() { return _CPDefinitionInventoryId; } @Override public void setPrimaryKey(long primaryKey) { setCPDefinitionInventoryId(primaryKey); } @Override public Serializable getPrimaryKeyObj() { return _CPDefinitionInventoryId; } @Override public void setPrimaryKeyObj(Serializable primaryKeyObj) { setPrimaryKey(((Long)primaryKeyObj).longValue()); } @Override public Class getModelClass() { return CPDefinitionInventory.class; } @Override public String getModelClassName() { return CPDefinitionInventory.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((CPDefinitionInventory)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( (CPDefinitionInventory)this, entry.getValue()); } } } public Map> getAttributeGetterFunctions() { return _attributeGetterFunctions; } public Map> getAttributeSetterBiConsumers() { return _attributeSetterBiConsumers; } private static Function _getProxyProviderFunction() { Class proxyClass = ProxyUtil.getProxyClass( CPDefinitionInventory.class.getClassLoader(), CPDefinitionInventory.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", CPDefinitionInventory::getUuid); attributeSetterBiConsumers.put( "uuid", (BiConsumer) CPDefinitionInventory::setUuid); attributeGetterFunctions.put( "CPDefinitionInventoryId", CPDefinitionInventory::getCPDefinitionInventoryId); attributeSetterBiConsumers.put( "CPDefinitionInventoryId", (BiConsumer) CPDefinitionInventory::setCPDefinitionInventoryId); attributeGetterFunctions.put( "groupId", CPDefinitionInventory::getGroupId); attributeSetterBiConsumers.put( "groupId", (BiConsumer) CPDefinitionInventory::setGroupId); attributeGetterFunctions.put( "companyId", CPDefinitionInventory::getCompanyId); attributeSetterBiConsumers.put( "companyId", (BiConsumer) CPDefinitionInventory::setCompanyId); attributeGetterFunctions.put( "userId", CPDefinitionInventory::getUserId); attributeSetterBiConsumers.put( "userId", (BiConsumer) CPDefinitionInventory::setUserId); attributeGetterFunctions.put( "userName", CPDefinitionInventory::getUserName); attributeSetterBiConsumers.put( "userName", (BiConsumer) CPDefinitionInventory::setUserName); attributeGetterFunctions.put( "createDate", CPDefinitionInventory::getCreateDate); attributeSetterBiConsumers.put( "createDate", (BiConsumer) CPDefinitionInventory::setCreateDate); attributeGetterFunctions.put( "modifiedDate", CPDefinitionInventory::getModifiedDate); attributeSetterBiConsumers.put( "modifiedDate", (BiConsumer) CPDefinitionInventory::setModifiedDate); attributeGetterFunctions.put( "CPDefinitionId", CPDefinitionInventory::getCPDefinitionId); attributeSetterBiConsumers.put( "CPDefinitionId", (BiConsumer) CPDefinitionInventory::setCPDefinitionId); attributeGetterFunctions.put( "CPDefinitionInventoryEngine", CPDefinitionInventory::getCPDefinitionInventoryEngine); attributeSetterBiConsumers.put( "CPDefinitionInventoryEngine", (BiConsumer) CPDefinitionInventory::setCPDefinitionInventoryEngine); attributeGetterFunctions.put( "lowStockActivity", CPDefinitionInventory::getLowStockActivity); attributeSetterBiConsumers.put( "lowStockActivity", (BiConsumer) CPDefinitionInventory::setLowStockActivity); attributeGetterFunctions.put( "displayAvailability", CPDefinitionInventory::getDisplayAvailability); attributeSetterBiConsumers.put( "displayAvailability", (BiConsumer) CPDefinitionInventory::setDisplayAvailability); attributeGetterFunctions.put( "displayStockQuantity", CPDefinitionInventory::getDisplayStockQuantity); attributeSetterBiConsumers.put( "displayStockQuantity", (BiConsumer) CPDefinitionInventory::setDisplayStockQuantity); attributeGetterFunctions.put( "minStockQuantity", CPDefinitionInventory::getMinStockQuantity); attributeSetterBiConsumers.put( "minStockQuantity", (BiConsumer) CPDefinitionInventory::setMinStockQuantity); attributeGetterFunctions.put( "backOrders", CPDefinitionInventory::getBackOrders); attributeSetterBiConsumers.put( "backOrders", (BiConsumer) CPDefinitionInventory::setBackOrders); attributeGetterFunctions.put( "minOrderQuantity", CPDefinitionInventory::getMinOrderQuantity); attributeSetterBiConsumers.put( "minOrderQuantity", (BiConsumer) CPDefinitionInventory::setMinOrderQuantity); attributeGetterFunctions.put( "maxOrderQuantity", CPDefinitionInventory::getMaxOrderQuantity); attributeSetterBiConsumers.put( "maxOrderQuantity", (BiConsumer) CPDefinitionInventory::setMaxOrderQuantity); attributeGetterFunctions.put( "allowedOrderQuantities", CPDefinitionInventory::getAllowedOrderQuantities); attributeSetterBiConsumers.put( "allowedOrderQuantities", (BiConsumer) CPDefinitionInventory::setAllowedOrderQuantities); attributeGetterFunctions.put( "multipleOrderQuantity", CPDefinitionInventory::getMultipleOrderQuantity); attributeSetterBiConsumers.put( "multipleOrderQuantity", (BiConsumer) CPDefinitionInventory::setMultipleOrderQuantity); _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) { 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 long getCPDefinitionInventoryId() { return _CPDefinitionInventoryId; } @Override public void setCPDefinitionInventoryId(long CPDefinitionInventoryId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _CPDefinitionInventoryId = CPDefinitionInventoryId; } @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 getCPDefinitionInventoryEngine() { if (_CPDefinitionInventoryEngine == null) { return ""; } else { return _CPDefinitionInventoryEngine; } } @Override public void setCPDefinitionInventoryEngine( String CPDefinitionInventoryEngine) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _CPDefinitionInventoryEngine = CPDefinitionInventoryEngine; } @JSON @Override public String getLowStockActivity() { if (_lowStockActivity == null) { return ""; } else { return _lowStockActivity; } } @Override public void setLowStockActivity(String lowStockActivity) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _lowStockActivity = lowStockActivity; } @JSON @Override public boolean getDisplayAvailability() { return _displayAvailability; } @JSON @Override public boolean isDisplayAvailability() { return _displayAvailability; } @Override public void setDisplayAvailability(boolean displayAvailability) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _displayAvailability = displayAvailability; } @JSON @Override public boolean getDisplayStockQuantity() { return _displayStockQuantity; } @JSON @Override public boolean isDisplayStockQuantity() { return _displayStockQuantity; } @Override public void setDisplayStockQuantity(boolean displayStockQuantity) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _displayStockQuantity = displayStockQuantity; } @JSON @Override public int getMinStockQuantity() { return _minStockQuantity; } @Override public void setMinStockQuantity(int minStockQuantity) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _minStockQuantity = minStockQuantity; } @JSON @Override public boolean getBackOrders() { return _backOrders; } @JSON @Override public boolean isBackOrders() { return _backOrders; } @Override public void setBackOrders(boolean backOrders) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _backOrders = backOrders; } @JSON @Override public int getMinOrderQuantity() { return _minOrderQuantity; } @Override public void setMinOrderQuantity(int minOrderQuantity) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _minOrderQuantity = minOrderQuantity; } @JSON @Override public int getMaxOrderQuantity() { return _maxOrderQuantity; } @Override public void setMaxOrderQuantity(int maxOrderQuantity) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _maxOrderQuantity = maxOrderQuantity; } @JSON @Override public String getAllowedOrderQuantities() { if (_allowedOrderQuantities == null) { return ""; } else { return _allowedOrderQuantities; } } @Override public void setAllowedOrderQuantities(String allowedOrderQuantities) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _allowedOrderQuantities = allowedOrderQuantities; } @JSON @Override public int getMultipleOrderQuantity() { return _multipleOrderQuantity; } @Override public void setMultipleOrderQuantity(int multipleOrderQuantity) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _multipleOrderQuantity = multipleOrderQuantity; } @Override public StagedModelType getStagedModelType() { return new StagedModelType( PortalUtil.getClassNameId(CPDefinitionInventory.class.getName())); } public long getColumnBitmask() { if (_columnBitmask > 0) { return _columnBitmask; } if ((_columnOriginalValues == null) || (_columnOriginalValues == Collections.EMPTY_MAP)) { return 0; } for (Map.Entry entry : _columnOriginalValues.entrySet()) { if (entry.getValue() != getColumnValue(entry.getKey())) { _columnBitmask |= _columnBitmasks.get(entry.getKey()); } } return _columnBitmask; } @Override public ExpandoBridge getExpandoBridge() { return ExpandoBridgeFactoryUtil.getExpandoBridge( getCompanyId(), CPDefinitionInventory.class.getName(), getPrimaryKey()); } @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext) { ExpandoBridge expandoBridge = getExpandoBridge(); expandoBridge.setAttributes(serviceContext); } @Override public CPDefinitionInventory toEscapedModel() { if (_escapedModel == null) { Function escapedModelProxyProviderFunction = EscapedModelProxyProviderFunctionHolder. _escapedModelProxyProviderFunction; _escapedModel = escapedModelProxyProviderFunction.apply( new AutoEscapeBeanHandler(this)); } return _escapedModel; } @Override public Object clone() { CPDefinitionInventoryImpl cpDefinitionInventoryImpl = new CPDefinitionInventoryImpl(); cpDefinitionInventoryImpl.setUuid(getUuid()); cpDefinitionInventoryImpl.setCPDefinitionInventoryId( getCPDefinitionInventoryId()); cpDefinitionInventoryImpl.setGroupId(getGroupId()); cpDefinitionInventoryImpl.setCompanyId(getCompanyId()); cpDefinitionInventoryImpl.setUserId(getUserId()); cpDefinitionInventoryImpl.setUserName(getUserName()); cpDefinitionInventoryImpl.setCreateDate(getCreateDate()); cpDefinitionInventoryImpl.setModifiedDate(getModifiedDate()); cpDefinitionInventoryImpl.setCPDefinitionId(getCPDefinitionId()); cpDefinitionInventoryImpl.setCPDefinitionInventoryEngine( getCPDefinitionInventoryEngine()); cpDefinitionInventoryImpl.setLowStockActivity(getLowStockActivity()); cpDefinitionInventoryImpl.setDisplayAvailability( isDisplayAvailability()); cpDefinitionInventoryImpl.setDisplayStockQuantity( isDisplayStockQuantity()); cpDefinitionInventoryImpl.setMinStockQuantity(getMinStockQuantity()); cpDefinitionInventoryImpl.setBackOrders(isBackOrders()); cpDefinitionInventoryImpl.setMinOrderQuantity(getMinOrderQuantity()); cpDefinitionInventoryImpl.setMaxOrderQuantity(getMaxOrderQuantity()); cpDefinitionInventoryImpl.setAllowedOrderQuantities( getAllowedOrderQuantities()); cpDefinitionInventoryImpl.setMultipleOrderQuantity( getMultipleOrderQuantity()); cpDefinitionInventoryImpl.resetOriginalValues(); return cpDefinitionInventoryImpl; } @Override public int compareTo(CPDefinitionInventory cpDefinitionInventory) { long primaryKey = cpDefinitionInventory.getPrimaryKey(); if (getPrimaryKey() < primaryKey) { return -1; } else if (getPrimaryKey() > primaryKey) { return 1; } else { return 0; } } @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CPDefinitionInventory)) { return false; } CPDefinitionInventory cpDefinitionInventory = (CPDefinitionInventory)object; long primaryKey = cpDefinitionInventory.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 ENTITY_CACHE_ENABLED; } /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated @Override public boolean isFinderCacheEnabled() { return FINDER_CACHE_ENABLED; } @Override public void resetOriginalValues() { _columnOriginalValues = Collections.emptyMap(); _setModifiedDate = false; _columnBitmask = 0; } @Override public CacheModel toCacheModel() { CPDefinitionInventoryCacheModel cpDefinitionInventoryCacheModel = new CPDefinitionInventoryCacheModel(); cpDefinitionInventoryCacheModel.uuid = getUuid(); String uuid = cpDefinitionInventoryCacheModel.uuid; if ((uuid != null) && (uuid.length() == 0)) { cpDefinitionInventoryCacheModel.uuid = null; } cpDefinitionInventoryCacheModel.CPDefinitionInventoryId = getCPDefinitionInventoryId(); cpDefinitionInventoryCacheModel.groupId = getGroupId(); cpDefinitionInventoryCacheModel.companyId = getCompanyId(); cpDefinitionInventoryCacheModel.userId = getUserId(); cpDefinitionInventoryCacheModel.userName = getUserName(); String userName = cpDefinitionInventoryCacheModel.userName; if ((userName != null) && (userName.length() == 0)) { cpDefinitionInventoryCacheModel.userName = null; } Date createDate = getCreateDate(); if (createDate != null) { cpDefinitionInventoryCacheModel.createDate = createDate.getTime(); } else { cpDefinitionInventoryCacheModel.createDate = Long.MIN_VALUE; } Date modifiedDate = getModifiedDate(); if (modifiedDate != null) { cpDefinitionInventoryCacheModel.modifiedDate = modifiedDate.getTime(); } else { cpDefinitionInventoryCacheModel.modifiedDate = Long.MIN_VALUE; } cpDefinitionInventoryCacheModel.CPDefinitionId = getCPDefinitionId(); cpDefinitionInventoryCacheModel.CPDefinitionInventoryEngine = getCPDefinitionInventoryEngine(); String CPDefinitionInventoryEngine = cpDefinitionInventoryCacheModel.CPDefinitionInventoryEngine; if ((CPDefinitionInventoryEngine != null) && (CPDefinitionInventoryEngine.length() == 0)) { cpDefinitionInventoryCacheModel.CPDefinitionInventoryEngine = null; } cpDefinitionInventoryCacheModel.lowStockActivity = getLowStockActivity(); String lowStockActivity = cpDefinitionInventoryCacheModel.lowStockActivity; if ((lowStockActivity != null) && (lowStockActivity.length() == 0)) { cpDefinitionInventoryCacheModel.lowStockActivity = null; } cpDefinitionInventoryCacheModel.displayAvailability = isDisplayAvailability(); cpDefinitionInventoryCacheModel.displayStockQuantity = isDisplayStockQuantity(); cpDefinitionInventoryCacheModel.minStockQuantity = getMinStockQuantity(); cpDefinitionInventoryCacheModel.backOrders = isBackOrders(); cpDefinitionInventoryCacheModel.minOrderQuantity = getMinOrderQuantity(); cpDefinitionInventoryCacheModel.maxOrderQuantity = getMaxOrderQuantity(); cpDefinitionInventoryCacheModel.allowedOrderQuantities = getAllowedOrderQuantities(); String allowedOrderQuantities = cpDefinitionInventoryCacheModel.allowedOrderQuantities; if ((allowedOrderQuantities != null) && (allowedOrderQuantities.length() == 0)) { cpDefinitionInventoryCacheModel.allowedOrderQuantities = null; } cpDefinitionInventoryCacheModel.multipleOrderQuantity = getMultipleOrderQuantity(); return cpDefinitionInventoryCacheModel; } @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((CPDefinitionInventory)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 long _CPDefinitionInventoryId; 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 _CPDefinitionInventoryEngine; private String _lowStockActivity; private boolean _displayAvailability; private boolean _displayStockQuantity; private int _minStockQuantity; private boolean _backOrders; private int _minOrderQuantity; private int _maxOrderQuantity; private String _allowedOrderQuantities; private int _multipleOrderQuantity; public T getColumnValue(String columnName) { columnName = _attributeNames.getOrDefault(columnName, columnName); Function function = _attributeGetterFunctions.get(columnName); if (function == null) { throw new IllegalArgumentException( "No attribute getter function found for " + columnName); } return (T)function.apply((CPDefinitionInventory)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("uuid_", _uuid); _columnOriginalValues.put( "CPDefinitionInventoryId", _CPDefinitionInventoryId); _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( "CPDefinitionInventoryEngine", _CPDefinitionInventoryEngine); _columnOriginalValues.put("lowStockActivity", _lowStockActivity); _columnOriginalValues.put("displayAvailability", _displayAvailability); _columnOriginalValues.put( "displayStockQuantity", _displayStockQuantity); _columnOriginalValues.put("minStockQuantity", _minStockQuantity); _columnOriginalValues.put("backOrders", _backOrders); _columnOriginalValues.put("minOrderQuantity", _minOrderQuantity); _columnOriginalValues.put("maxOrderQuantity", _maxOrderQuantity); _columnOriginalValues.put( "allowedOrderQuantities", _allowedOrderQuantities); _columnOriginalValues.put( "multipleOrderQuantity", _multipleOrderQuantity); } private static final Map _attributeNames; static { Map attributeNames = new HashMap<>(); attributeNames.put("uuid_", "uuid"); _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("uuid_", 1L); columnBitmasks.put("CPDefinitionInventoryId", 2L); columnBitmasks.put("groupId", 4L); columnBitmasks.put("companyId", 8L); columnBitmasks.put("userId", 16L); columnBitmasks.put("userName", 32L); columnBitmasks.put("createDate", 64L); columnBitmasks.put("modifiedDate", 128L); columnBitmasks.put("CPDefinitionId", 256L); columnBitmasks.put("CPDefinitionInventoryEngine", 512L); columnBitmasks.put("lowStockActivity", 1024L); columnBitmasks.put("displayAvailability", 2048L); columnBitmasks.put("displayStockQuantity", 4096L); columnBitmasks.put("minStockQuantity", 8192L); columnBitmasks.put("backOrders", 16384L); columnBitmasks.put("minOrderQuantity", 32768L); columnBitmasks.put("maxOrderQuantity", 65536L); columnBitmasks.put("allowedOrderQuantities", 131072L); columnBitmasks.put("multipleOrderQuantity", 262144L); _columnBitmasks = Collections.unmodifiableMap(columnBitmasks); } private long _columnBitmask; private CPDefinitionInventory _escapedModel; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy