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

com.liferay.object.model.impl.ObjectDefinitionModelImpl Maven / Gradle / Ivy

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

package com.liferay.object.model.impl;

import com.liferay.expando.kernel.model.ExpandoBridge;
import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
import com.liferay.exportimport.kernel.lar.StagedModelType;
import com.liferay.object.model.ObjectDefinition;
import com.liferay.object.model.ObjectDefinitionModel;
import com.liferay.petra.string.StringBundler;
import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.LocaleException;
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.LocaleUtil;
import com.liferay.portal.kernel.util.LocalizationUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;

import java.io.Serializable;

import java.lang.reflect.InvocationHandler;

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

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

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

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

* * @author Marco Leo * @see ObjectDefinitionImpl * @generated */ @JSON(strict = true) public class ObjectDefinitionModelImpl extends BaseModelImpl implements ObjectDefinitionModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. All methods that expect a object definition model instance should use the ObjectDefinition interface instead. */ public static final String TABLE_NAME = "ObjectDefinition"; public static final Object[][] TABLE_COLUMNS = { {"mvccVersion", Types.BIGINT}, {"uuid_", Types.VARCHAR}, {"externalReferenceCode", Types.VARCHAR}, {"objectDefinitionId", Types.BIGINT}, {"companyId", Types.BIGINT}, {"userId", Types.BIGINT}, {"userName", Types.VARCHAR}, {"createDate", Types.TIMESTAMP}, {"modifiedDate", Types.TIMESTAMP}, {"accountERObjectFieldId", Types.BIGINT}, {"descriptionObjectFieldId", Types.BIGINT}, {"objectFolderId", Types.BIGINT}, {"rootObjectDefinitionId", Types.BIGINT}, {"titleObjectFieldId", Types.BIGINT}, {"accountEntryRestricted", Types.BOOLEAN}, {"active_", Types.BOOLEAN}, {"className", Types.VARCHAR}, {"dbTableName", Types.VARCHAR}, {"enableCategorization", Types.BOOLEAN}, {"enableComments", Types.BOOLEAN}, {"enableIndexSearch", Types.BOOLEAN}, {"enableLocalization", Types.BOOLEAN}, {"enableObjectEntryDraft", Types.BOOLEAN}, {"enableObjectEntryHistory", Types.BOOLEAN}, {"label", Types.VARCHAR}, {"modifiable", Types.BOOLEAN}, {"name", Types.VARCHAR}, {"panelAppOrder", Types.VARCHAR}, {"panelCategoryKey", Types.VARCHAR}, {"pkObjectFieldDBColumnName", Types.VARCHAR}, {"pkObjectFieldName", Types.VARCHAR}, {"pluralLabel", Types.VARCHAR}, {"portlet", Types.BOOLEAN}, {"scope", Types.VARCHAR}, {"storageType", Types.VARCHAR}, {"system_", Types.BOOLEAN}, {"version", Types.INTEGER}, {"status", Types.INTEGER} }; public static final Map TABLE_COLUMNS_MAP = new HashMap(); static { TABLE_COLUMNS_MAP.put("mvccVersion", Types.BIGINT); TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR); TABLE_COLUMNS_MAP.put("externalReferenceCode", Types.VARCHAR); TABLE_COLUMNS_MAP.put("objectDefinitionId", 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("accountERObjectFieldId", Types.BIGINT); TABLE_COLUMNS_MAP.put("descriptionObjectFieldId", Types.BIGINT); TABLE_COLUMNS_MAP.put("objectFolderId", Types.BIGINT); TABLE_COLUMNS_MAP.put("rootObjectDefinitionId", Types.BIGINT); TABLE_COLUMNS_MAP.put("titleObjectFieldId", Types.BIGINT); TABLE_COLUMNS_MAP.put("accountEntryRestricted", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("active_", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("className", Types.VARCHAR); TABLE_COLUMNS_MAP.put("dbTableName", Types.VARCHAR); TABLE_COLUMNS_MAP.put("enableCategorization", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("enableComments", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("enableIndexSearch", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("enableLocalization", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("enableObjectEntryDraft", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("enableObjectEntryHistory", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("label", Types.VARCHAR); TABLE_COLUMNS_MAP.put("modifiable", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("name", Types.VARCHAR); TABLE_COLUMNS_MAP.put("panelAppOrder", Types.VARCHAR); TABLE_COLUMNS_MAP.put("panelCategoryKey", Types.VARCHAR); TABLE_COLUMNS_MAP.put("pkObjectFieldDBColumnName", Types.VARCHAR); TABLE_COLUMNS_MAP.put("pkObjectFieldName", Types.VARCHAR); TABLE_COLUMNS_MAP.put("pluralLabel", Types.VARCHAR); TABLE_COLUMNS_MAP.put("portlet", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("scope", Types.VARCHAR); TABLE_COLUMNS_MAP.put("storageType", Types.VARCHAR); TABLE_COLUMNS_MAP.put("system_", Types.BOOLEAN); TABLE_COLUMNS_MAP.put("version", Types.INTEGER); TABLE_COLUMNS_MAP.put("status", Types.INTEGER); } public static final String TABLE_SQL_CREATE = "create table ObjectDefinition (mvccVersion LONG default 0 not null,uuid_ VARCHAR(75) null,externalReferenceCode VARCHAR(75) null,objectDefinitionId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,accountERObjectFieldId LONG,descriptionObjectFieldId LONG,objectFolderId LONG,rootObjectDefinitionId LONG,titleObjectFieldId LONG,accountEntryRestricted BOOLEAN,active_ BOOLEAN,className VARCHAR(255) null,dbTableName VARCHAR(75) null,enableCategorization BOOLEAN,enableComments BOOLEAN,enableIndexSearch BOOLEAN,enableLocalization BOOLEAN,enableObjectEntryDraft BOOLEAN,enableObjectEntryHistory BOOLEAN,label STRING null,modifiable BOOLEAN,name VARCHAR(75) null,panelAppOrder VARCHAR(75) null,panelCategoryKey VARCHAR(75) null,pkObjectFieldDBColumnName VARCHAR(75) null,pkObjectFieldName VARCHAR(75) null,pluralLabel STRING null,portlet BOOLEAN,scope VARCHAR(75) null,storageType VARCHAR(255) null,system_ BOOLEAN,version INTEGER,status INTEGER)"; public static final String TABLE_SQL_DROP = "drop table ObjectDefinition"; public static final String ORDER_BY_JPQL = " ORDER BY objectDefinition.name ASC"; public static final String ORDER_BY_SQL = " ORDER BY ObjectDefinition.name ASC"; public static final String ORDER_BY_SQL_INLINE_DISTINCT = " ORDER BY objectDefinition.name 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), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long ACCOUNTENTRYRESTRICTED_COLUMN_BITMASK = 1L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long ACTIVE_COLUMN_BITMASK = 2L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long CLASSNAME_COLUMN_BITMASK = 4L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long COMPANYID_COLUMN_BITMASK = 8L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long EXTERNALREFERENCECODE_COLUMN_BITMASK = 16L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long MODIFIABLE_COLUMN_BITMASK = 32L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long NAME_COLUMN_BITMASK = 64L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long OBJECTFOLDERID_COLUMN_BITMASK = 128L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long ROOTOBJECTDEFINITIONID_COLUMN_BITMASK = 256L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long STATUS_COLUMN_BITMASK = 512L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long SYSTEM_COLUMN_BITMASK = 1024L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long USERID_COLUMN_BITMASK = 2048L; /** * @deprecated As of Athanasius (7.3.x), replaced by {@link #getColumnBitmask(String)} */ @Deprecated public static final long UUID_COLUMN_BITMASK = 4096L; /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static void setEntityCacheEnabled(boolean entityCacheEnabled) { } /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated public static void setFinderCacheEnabled(boolean finderCacheEnabled) { } public ObjectDefinitionModelImpl() { } @Override public long getPrimaryKey() { return _objectDefinitionId; } @Override public void setPrimaryKey(long primaryKey) { setObjectDefinitionId(primaryKey); } @Override public Serializable getPrimaryKeyObj() { return _objectDefinitionId; } @Override public void setPrimaryKeyObj(Serializable primaryKeyObj) { setPrimaryKey(((Long)primaryKeyObj).longValue()); } @Override public Class getModelClass() { return ObjectDefinition.class; } @Override public String getModelClassName() { return ObjectDefinition.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((ObjectDefinition)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( (ObjectDefinition)this, entry.getValue()); } } } public Map> getAttributeGetterFunctions() { return AttributeGetterFunctionsHolder._attributeGetterFunctions; } public Map> getAttributeSetterBiConsumers() { return AttributeSetterBiConsumersHolder._attributeSetterBiConsumers; } private static class AttributeGetterFunctionsHolder { private static final Map> _attributeGetterFunctions; static { Map> attributeGetterFunctions = new LinkedHashMap >(); attributeGetterFunctions.put( "mvccVersion", ObjectDefinition::getMvccVersion); attributeGetterFunctions.put("uuid", ObjectDefinition::getUuid); attributeGetterFunctions.put( "externalReferenceCode", ObjectDefinition::getExternalReferenceCode); attributeGetterFunctions.put( "objectDefinitionId", ObjectDefinition::getObjectDefinitionId); attributeGetterFunctions.put( "companyId", ObjectDefinition::getCompanyId); attributeGetterFunctions.put("userId", ObjectDefinition::getUserId); attributeGetterFunctions.put( "userName", ObjectDefinition::getUserName); attributeGetterFunctions.put( "createDate", ObjectDefinition::getCreateDate); attributeGetterFunctions.put( "modifiedDate", ObjectDefinition::getModifiedDate); attributeGetterFunctions.put( "accountEntryRestrictedObjectFieldId", ObjectDefinition::getAccountEntryRestrictedObjectFieldId); attributeGetterFunctions.put( "descriptionObjectFieldId", ObjectDefinition::getDescriptionObjectFieldId); attributeGetterFunctions.put( "objectFolderId", ObjectDefinition::getObjectFolderId); attributeGetterFunctions.put( "rootObjectDefinitionId", ObjectDefinition::getRootObjectDefinitionId); attributeGetterFunctions.put( "titleObjectFieldId", ObjectDefinition::getTitleObjectFieldId); attributeGetterFunctions.put( "accountEntryRestricted", ObjectDefinition::getAccountEntryRestricted); attributeGetterFunctions.put("active", ObjectDefinition::getActive); attributeGetterFunctions.put( "className", ObjectDefinition::getClassName); attributeGetterFunctions.put( "dbTableName", ObjectDefinition::getDBTableName); attributeGetterFunctions.put( "enableCategorization", ObjectDefinition::getEnableCategorization); attributeGetterFunctions.put( "enableComments", ObjectDefinition::getEnableComments); attributeGetterFunctions.put( "enableIndexSearch", ObjectDefinition::getEnableIndexSearch); attributeGetterFunctions.put( "enableLocalization", ObjectDefinition::getEnableLocalization); attributeGetterFunctions.put( "enableObjectEntryDraft", ObjectDefinition::getEnableObjectEntryDraft); attributeGetterFunctions.put( "enableObjectEntryHistory", ObjectDefinition::getEnableObjectEntryHistory); attributeGetterFunctions.put("label", ObjectDefinition::getLabel); attributeGetterFunctions.put( "modifiable", ObjectDefinition::getModifiable); attributeGetterFunctions.put("name", ObjectDefinition::getName); attributeGetterFunctions.put( "panelAppOrder", ObjectDefinition::getPanelAppOrder); attributeGetterFunctions.put( "panelCategoryKey", ObjectDefinition::getPanelCategoryKey); attributeGetterFunctions.put( "pkObjectFieldDBColumnName", ObjectDefinition::getPKObjectFieldDBColumnName); attributeGetterFunctions.put( "pkObjectFieldName", ObjectDefinition::getPKObjectFieldName); attributeGetterFunctions.put( "pluralLabel", ObjectDefinition::getPluralLabel); attributeGetterFunctions.put( "portlet", ObjectDefinition::getPortlet); attributeGetterFunctions.put("scope", ObjectDefinition::getScope); attributeGetterFunctions.put( "storageType", ObjectDefinition::getStorageType); attributeGetterFunctions.put("system", ObjectDefinition::getSystem); attributeGetterFunctions.put( "version", ObjectDefinition::getVersion); attributeGetterFunctions.put("status", ObjectDefinition::getStatus); _attributeGetterFunctions = Collections.unmodifiableMap( attributeGetterFunctions); } } private static class AttributeSetterBiConsumersHolder { private static final Map> _attributeSetterBiConsumers; static { Map> attributeSetterBiConsumers = new LinkedHashMap >(); attributeSetterBiConsumers.put( "mvccVersion", (BiConsumer) ObjectDefinition::setMvccVersion); attributeSetterBiConsumers.put( "uuid", (BiConsumer) ObjectDefinition::setUuid); attributeSetterBiConsumers.put( "externalReferenceCode", (BiConsumer) ObjectDefinition::setExternalReferenceCode); attributeSetterBiConsumers.put( "objectDefinitionId", (BiConsumer) ObjectDefinition::setObjectDefinitionId); attributeSetterBiConsumers.put( "companyId", (BiConsumer) ObjectDefinition::setCompanyId); attributeSetterBiConsumers.put( "userId", (BiConsumer) ObjectDefinition::setUserId); attributeSetterBiConsumers.put( "userName", (BiConsumer) ObjectDefinition::setUserName); attributeSetterBiConsumers.put( "createDate", (BiConsumer) ObjectDefinition::setCreateDate); attributeSetterBiConsumers.put( "modifiedDate", (BiConsumer) ObjectDefinition::setModifiedDate); attributeSetterBiConsumers.put( "accountEntryRestrictedObjectFieldId", (BiConsumer) ObjectDefinition::setAccountEntryRestrictedObjectFieldId); attributeSetterBiConsumers.put( "descriptionObjectFieldId", (BiConsumer) ObjectDefinition::setDescriptionObjectFieldId); attributeSetterBiConsumers.put( "objectFolderId", (BiConsumer) ObjectDefinition::setObjectFolderId); attributeSetterBiConsumers.put( "rootObjectDefinitionId", (BiConsumer) ObjectDefinition::setRootObjectDefinitionId); attributeSetterBiConsumers.put( "titleObjectFieldId", (BiConsumer) ObjectDefinition::setTitleObjectFieldId); attributeSetterBiConsumers.put( "accountEntryRestricted", (BiConsumer) ObjectDefinition::setAccountEntryRestricted); attributeSetterBiConsumers.put( "active", (BiConsumer) ObjectDefinition::setActive); attributeSetterBiConsumers.put( "className", (BiConsumer) ObjectDefinition::setClassName); attributeSetterBiConsumers.put( "dbTableName", (BiConsumer) ObjectDefinition::setDBTableName); attributeSetterBiConsumers.put( "enableCategorization", (BiConsumer) ObjectDefinition::setEnableCategorization); attributeSetterBiConsumers.put( "enableComments", (BiConsumer) ObjectDefinition::setEnableComments); attributeSetterBiConsumers.put( "enableIndexSearch", (BiConsumer) ObjectDefinition::setEnableIndexSearch); attributeSetterBiConsumers.put( "enableLocalization", (BiConsumer) ObjectDefinition::setEnableLocalization); attributeSetterBiConsumers.put( "enableObjectEntryDraft", (BiConsumer) ObjectDefinition::setEnableObjectEntryDraft); attributeSetterBiConsumers.put( "enableObjectEntryHistory", (BiConsumer) ObjectDefinition::setEnableObjectEntryHistory); attributeSetterBiConsumers.put( "label", (BiConsumer) ObjectDefinition::setLabel); attributeSetterBiConsumers.put( "modifiable", (BiConsumer) ObjectDefinition::setModifiable); attributeSetterBiConsumers.put( "name", (BiConsumer) ObjectDefinition::setName); attributeSetterBiConsumers.put( "panelAppOrder", (BiConsumer) ObjectDefinition::setPanelAppOrder); attributeSetterBiConsumers.put( "panelCategoryKey", (BiConsumer) ObjectDefinition::setPanelCategoryKey); attributeSetterBiConsumers.put( "pkObjectFieldDBColumnName", (BiConsumer) ObjectDefinition::setPKObjectFieldDBColumnName); attributeSetterBiConsumers.put( "pkObjectFieldName", (BiConsumer) ObjectDefinition::setPKObjectFieldName); attributeSetterBiConsumers.put( "pluralLabel", (BiConsumer) ObjectDefinition::setPluralLabel); attributeSetterBiConsumers.put( "portlet", (BiConsumer) ObjectDefinition::setPortlet); attributeSetterBiConsumers.put( "scope", (BiConsumer) ObjectDefinition::setScope); attributeSetterBiConsumers.put( "storageType", (BiConsumer) ObjectDefinition::setStorageType); attributeSetterBiConsumers.put( "system", (BiConsumer) ObjectDefinition::setSystem); attributeSetterBiConsumers.put( "version", (BiConsumer) ObjectDefinition::setVersion); attributeSetterBiConsumers.put( "status", (BiConsumer) ObjectDefinition::setStatus); _attributeSetterBiConsumers = Collections.unmodifiableMap( (Map)attributeSetterBiConsumers); } } @JSON @Override public long getMvccVersion() { return _mvccVersion; } @Override public void setMvccVersion(long mvccVersion) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _mvccVersion = mvccVersion; } @JSON @Override public String getUuid() { if (_uuid == null) { return ""; } else { return _uuid; } } @Override public void setUuid(String uuid) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _uuid = uuid; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalUuid() { return getColumnOriginalValue("uuid_"); } @JSON @Override public String getExternalReferenceCode() { if (_externalReferenceCode == null) { return ""; } else { return _externalReferenceCode; } } @Override public void setExternalReferenceCode(String externalReferenceCode) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _externalReferenceCode = externalReferenceCode; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalExternalReferenceCode() { return getColumnOriginalValue("externalReferenceCode"); } @JSON @Override public long getObjectDefinitionId() { return _objectDefinitionId; } @Override public void setObjectDefinitionId(long objectDefinitionId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _objectDefinitionId = objectDefinitionId; } @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) { } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public long getOriginalUserId() { return GetterUtil.getLong(this.getColumnOriginalValue("userId")); } @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 getAccountEntryRestrictedObjectFieldId() { return _accountEntryRestrictedObjectFieldId; } @Override public void setAccountEntryRestrictedObjectFieldId( long accountEntryRestrictedObjectFieldId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _accountEntryRestrictedObjectFieldId = accountEntryRestrictedObjectFieldId; } @JSON @Override public long getDescriptionObjectFieldId() { return _descriptionObjectFieldId; } @Override public void setDescriptionObjectFieldId(long descriptionObjectFieldId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _descriptionObjectFieldId = descriptionObjectFieldId; } @JSON @Override public long getObjectFolderId() { return _objectFolderId; } @Override public void setObjectFolderId(long objectFolderId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _objectFolderId = objectFolderId; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public long getOriginalObjectFolderId() { return GetterUtil.getLong( this.getColumnOriginalValue("objectFolderId")); } @JSON @Override public long getRootObjectDefinitionId() { return _rootObjectDefinitionId; } @Override public void setRootObjectDefinitionId(long rootObjectDefinitionId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _rootObjectDefinitionId = rootObjectDefinitionId; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public long getOriginalRootObjectDefinitionId() { return GetterUtil.getLong( this.getColumnOriginalValue("rootObjectDefinitionId")); } @JSON @Override public long getTitleObjectFieldId() { return _titleObjectFieldId; } @Override public void setTitleObjectFieldId(long titleObjectFieldId) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _titleObjectFieldId = titleObjectFieldId; } @JSON @Override public boolean getAccountEntryRestricted() { return _accountEntryRestricted; } @JSON @Override public boolean isAccountEntryRestricted() { return _accountEntryRestricted; } @Override public void setAccountEntryRestricted(boolean accountEntryRestricted) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _accountEntryRestricted = accountEntryRestricted; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public boolean getOriginalAccountEntryRestricted() { return GetterUtil.getBoolean( this.getColumnOriginalValue("accountEntryRestricted")); } @JSON @Override public boolean getActive() { return _active; } @JSON @Override public boolean isActive() { return _active; } @Override public void setActive(boolean active) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _active = active; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public boolean getOriginalActive() { return GetterUtil.getBoolean( this.getColumnOriginalValue("active_")); } @JSON @Override public String getClassName() { if (_className == null) { return ""; } else { return _className; } } @Override public void setClassName(String className) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _className = className; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalClassName() { return getColumnOriginalValue("className"); } @JSON @Override public String getDBTableName() { if (_dbTableName == null) { return ""; } else { return _dbTableName; } } @Override public void setDBTableName(String dbTableName) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _dbTableName = dbTableName; } @JSON @Override public boolean getEnableCategorization() { return _enableCategorization; } @JSON @Override public boolean isEnableCategorization() { return _enableCategorization; } @Override public void setEnableCategorization(boolean enableCategorization) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _enableCategorization = enableCategorization; } @JSON @Override public boolean getEnableComments() { return _enableComments; } @JSON @Override public boolean isEnableComments() { return _enableComments; } @Override public void setEnableComments(boolean enableComments) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _enableComments = enableComments; } @JSON @Override public boolean getEnableIndexSearch() { return _enableIndexSearch; } @JSON @Override public boolean isEnableIndexSearch() { return _enableIndexSearch; } @Override public void setEnableIndexSearch(boolean enableIndexSearch) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _enableIndexSearch = enableIndexSearch; } @JSON @Override public boolean getEnableLocalization() { return _enableLocalization; } @JSON @Override public boolean isEnableLocalization() { return _enableLocalization; } @Override public void setEnableLocalization(boolean enableLocalization) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _enableLocalization = enableLocalization; } @JSON @Override public boolean getEnableObjectEntryDraft() { return _enableObjectEntryDraft; } @JSON @Override public boolean isEnableObjectEntryDraft() { return _enableObjectEntryDraft; } @Override public void setEnableObjectEntryDraft(boolean enableObjectEntryDraft) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _enableObjectEntryDraft = enableObjectEntryDraft; } @JSON @Override public boolean getEnableObjectEntryHistory() { return _enableObjectEntryHistory; } @JSON @Override public boolean isEnableObjectEntryHistory() { return _enableObjectEntryHistory; } @Override public void setEnableObjectEntryHistory(boolean enableObjectEntryHistory) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _enableObjectEntryHistory = enableObjectEntryHistory; } @JSON @Override public String getLabel() { if (_label == null) { return ""; } else { return _label; } } @Override public String getLabel(Locale locale) { String languageId = LocaleUtil.toLanguageId(locale); return getLabel(languageId); } @Override public String getLabel(Locale locale, boolean useDefault) { String languageId = LocaleUtil.toLanguageId(locale); return getLabel(languageId, useDefault); } @Override public String getLabel(String languageId) { return LocalizationUtil.getLocalization(getLabel(), languageId); } @Override public String getLabel(String languageId, boolean useDefault) { return LocalizationUtil.getLocalization( getLabel(), languageId, useDefault); } @Override public String getLabelCurrentLanguageId() { return _labelCurrentLanguageId; } @JSON @Override public String getLabelCurrentValue() { Locale locale = getLocale(_labelCurrentLanguageId); return getLabel(locale); } @Override public Map getLabelMap() { return LocalizationUtil.getLocalizationMap(getLabel()); } @Override public void setLabel(String label) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _label = label; } @Override public void setLabel(String label, Locale locale) { setLabel(label, locale, LocaleUtil.getDefault()); } @Override public void setLabel(String label, Locale locale, Locale defaultLocale) { String languageId = LocaleUtil.toLanguageId(locale); String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale); if (Validator.isNotNull(label)) { setLabel( LocalizationUtil.updateLocalization( getLabel(), "Label", label, languageId, defaultLanguageId)); } else { setLabel( LocalizationUtil.removeLocalization( getLabel(), "Label", languageId)); } } @Override public void setLabelCurrentLanguageId(String languageId) { _labelCurrentLanguageId = languageId; } @Override public void setLabelMap(Map labelMap) { setLabelMap(labelMap, LocaleUtil.getDefault()); } @Override public void setLabelMap( Map labelMap, Locale defaultLocale) { if (labelMap == null) { return; } setLabel( LocalizationUtil.updateLocalization( labelMap, getLabel(), "Label", LocaleUtil.toLanguageId(defaultLocale))); } @JSON @Override public boolean getModifiable() { return _modifiable; } @JSON @Override public boolean isModifiable() { return _modifiable; } @Override public void setModifiable(boolean modifiable) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _modifiable = modifiable; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public boolean getOriginalModifiable() { return GetterUtil.getBoolean( this.getColumnOriginalValue("modifiable")); } @JSON @Override public String getName() { if (_name == null) { return ""; } else { return _name; } } @Override public void setName(String name) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _name = name; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public String getOriginalName() { return getColumnOriginalValue("name"); } @JSON @Override public String getPanelAppOrder() { if (_panelAppOrder == null) { return ""; } else { return _panelAppOrder; } } @Override public void setPanelAppOrder(String panelAppOrder) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _panelAppOrder = panelAppOrder; } @JSON @Override public String getPanelCategoryKey() { if (_panelCategoryKey == null) { return ""; } else { return _panelCategoryKey; } } @Override public void setPanelCategoryKey(String panelCategoryKey) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _panelCategoryKey = panelCategoryKey; } @JSON @Override public String getPKObjectFieldDBColumnName() { if (_pkObjectFieldDBColumnName == null) { return ""; } else { return _pkObjectFieldDBColumnName; } } @Override public void setPKObjectFieldDBColumnName(String pkObjectFieldDBColumnName) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _pkObjectFieldDBColumnName = pkObjectFieldDBColumnName; } @JSON @Override public String getPKObjectFieldName() { if (_pkObjectFieldName == null) { return ""; } else { return _pkObjectFieldName; } } @Override public void setPKObjectFieldName(String pkObjectFieldName) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _pkObjectFieldName = pkObjectFieldName; } @JSON @Override public String getPluralLabel() { if (_pluralLabel == null) { return ""; } else { return _pluralLabel; } } @Override public String getPluralLabel(Locale locale) { String languageId = LocaleUtil.toLanguageId(locale); return getPluralLabel(languageId); } @Override public String getPluralLabel(Locale locale, boolean useDefault) { String languageId = LocaleUtil.toLanguageId(locale); return getPluralLabel(languageId, useDefault); } @Override public String getPluralLabel(String languageId) { return LocalizationUtil.getLocalization(getPluralLabel(), languageId); } @Override public String getPluralLabel(String languageId, boolean useDefault) { return LocalizationUtil.getLocalization( getPluralLabel(), languageId, useDefault); } @Override public String getPluralLabelCurrentLanguageId() { return _pluralLabelCurrentLanguageId; } @JSON @Override public String getPluralLabelCurrentValue() { Locale locale = getLocale(_pluralLabelCurrentLanguageId); return getPluralLabel(locale); } @Override public Map getPluralLabelMap() { return LocalizationUtil.getLocalizationMap(getPluralLabel()); } @Override public void setPluralLabel(String pluralLabel) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _pluralLabel = pluralLabel; } @Override public void setPluralLabel(String pluralLabel, Locale locale) { setPluralLabel(pluralLabel, locale, LocaleUtil.getDefault()); } @Override public void setPluralLabel( String pluralLabel, Locale locale, Locale defaultLocale) { String languageId = LocaleUtil.toLanguageId(locale); String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale); if (Validator.isNotNull(pluralLabel)) { setPluralLabel( LocalizationUtil.updateLocalization( getPluralLabel(), "PluralLabel", pluralLabel, languageId, defaultLanguageId)); } else { setPluralLabel( LocalizationUtil.removeLocalization( getPluralLabel(), "PluralLabel", languageId)); } } @Override public void setPluralLabelCurrentLanguageId(String languageId) { _pluralLabelCurrentLanguageId = languageId; } @Override public void setPluralLabelMap(Map pluralLabelMap) { setPluralLabelMap(pluralLabelMap, LocaleUtil.getDefault()); } @Override public void setPluralLabelMap( Map pluralLabelMap, Locale defaultLocale) { if (pluralLabelMap == null) { return; } setPluralLabel( LocalizationUtil.updateLocalization( pluralLabelMap, getPluralLabel(), "PluralLabel", LocaleUtil.toLanguageId(defaultLocale))); } @JSON @Override public boolean getPortlet() { return _portlet; } @JSON @Override public boolean isPortlet() { return _portlet; } @Override public void setPortlet(boolean portlet) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _portlet = portlet; } @JSON @Override public String getScope() { if (_scope == null) { return ""; } else { return _scope; } } @Override public void setScope(String scope) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _scope = scope; } @JSON @Override public String getStorageType() { if (_storageType == null) { return ""; } else { return _storageType; } } @Override public void setStorageType(String storageType) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _storageType = storageType; } @JSON @Override public boolean getSystem() { return _system; } @JSON @Override public boolean isSystem() { return _system; } @Override public void setSystem(boolean system) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _system = system; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public boolean getOriginalSystem() { return GetterUtil.getBoolean( this.getColumnOriginalValue("system_")); } @JSON @Override public int getVersion() { return _version; } @Override public void setVersion(int version) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _version = version; } @JSON @Override public int getStatus() { return _status; } @Override public void setStatus(int status) { if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } _status = status; } /** * @deprecated As of Athanasius (7.3.x), replaced by {@link * #getColumnOriginalValue(String)} */ @Deprecated public int getOriginalStatus() { return GetterUtil.getInteger( this.getColumnOriginalValue("status")); } @Override public StagedModelType getStagedModelType() { return new StagedModelType( PortalUtil.getClassNameId(ObjectDefinition.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 (!Objects.equals( entry.getValue(), getColumnValue(entry.getKey()))) { _columnBitmask |= _columnBitmasks.get(entry.getKey()); } } return _columnBitmask; } @Override public ExpandoBridge getExpandoBridge() { return ExpandoBridgeFactoryUtil.getExpandoBridge( getCompanyId(), ObjectDefinition.class.getName(), getPrimaryKey()); } @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext) { ExpandoBridge expandoBridge = getExpandoBridge(); expandoBridge.setAttributes(serviceContext); } @Override public String[] getAvailableLanguageIds() { Set availableLanguageIds = new TreeSet(); Map labelMap = getLabelMap(); for (Map.Entry entry : labelMap.entrySet()) { Locale locale = entry.getKey(); String value = entry.getValue(); if (Validator.isNotNull(value)) { availableLanguageIds.add(LocaleUtil.toLanguageId(locale)); } } Map pluralLabelMap = getPluralLabelMap(); for (Map.Entry entry : pluralLabelMap.entrySet()) { Locale locale = entry.getKey(); String value = entry.getValue(); if (Validator.isNotNull(value)) { availableLanguageIds.add(LocaleUtil.toLanguageId(locale)); } } return availableLanguageIds.toArray( new String[availableLanguageIds.size()]); } @Override public String getDefaultLanguageId() { String xml = getLabel(); if (xml == null) { return ""; } Locale defaultLocale = LocaleUtil.getDefault(); return LocalizationUtil.getDefaultLanguageId(xml, defaultLocale); } @Override public void prepareLocalizedFieldsForImport() throws LocaleException { Locale defaultLocale = LocaleUtil.fromLanguageId( getDefaultLanguageId()); Locale[] availableLocales = LocaleUtil.fromLanguageIds( getAvailableLanguageIds()); Locale defaultImportLocale = LocalizationUtil.getDefaultImportLocale( ObjectDefinition.class.getName(), getPrimaryKey(), defaultLocale, availableLocales); prepareLocalizedFieldsForImport(defaultImportLocale); } @Override @SuppressWarnings("unused") public void prepareLocalizedFieldsForImport(Locale defaultImportLocale) throws LocaleException { Locale defaultLocale = LocaleUtil.getDefault(); String modelDefaultLanguageId = getDefaultLanguageId(); String label = getLabel(defaultLocale); if (Validator.isNull(label)) { setLabel(getLabel(modelDefaultLanguageId), defaultLocale); } else { setLabel(getLabel(defaultLocale), defaultLocale, defaultLocale); } String pluralLabel = getPluralLabel(defaultLocale); if (Validator.isNull(pluralLabel)) { setPluralLabel( getPluralLabel(modelDefaultLanguageId), defaultLocale); } else { setPluralLabel( getPluralLabel(defaultLocale), defaultLocale, defaultLocale); } } @Override public ObjectDefinition toEscapedModel() { if (_escapedModel == null) { Function escapedModelProxyProviderFunction = EscapedModelProxyProviderFunctionHolder. _escapedModelProxyProviderFunction; _escapedModel = escapedModelProxyProviderFunction.apply( new AutoEscapeBeanHandler(this)); } return _escapedModel; } @Override public Object clone() { ObjectDefinitionImpl objectDefinitionImpl = new ObjectDefinitionImpl(); objectDefinitionImpl.setMvccVersion(getMvccVersion()); objectDefinitionImpl.setUuid(getUuid()); objectDefinitionImpl.setExternalReferenceCode( getExternalReferenceCode()); objectDefinitionImpl.setObjectDefinitionId(getObjectDefinitionId()); objectDefinitionImpl.setCompanyId(getCompanyId()); objectDefinitionImpl.setUserId(getUserId()); objectDefinitionImpl.setUserName(getUserName()); objectDefinitionImpl.setCreateDate(getCreateDate()); objectDefinitionImpl.setModifiedDate(getModifiedDate()); objectDefinitionImpl.setAccountEntryRestrictedObjectFieldId( getAccountEntryRestrictedObjectFieldId()); objectDefinitionImpl.setDescriptionObjectFieldId( getDescriptionObjectFieldId()); objectDefinitionImpl.setObjectFolderId(getObjectFolderId()); objectDefinitionImpl.setRootObjectDefinitionId( getRootObjectDefinitionId()); objectDefinitionImpl.setTitleObjectFieldId(getTitleObjectFieldId()); objectDefinitionImpl.setAccountEntryRestricted( isAccountEntryRestricted()); objectDefinitionImpl.setActive(isActive()); objectDefinitionImpl.setClassName(getClassName()); objectDefinitionImpl.setDBTableName(getDBTableName()); objectDefinitionImpl.setEnableCategorization(isEnableCategorization()); objectDefinitionImpl.setEnableComments(isEnableComments()); objectDefinitionImpl.setEnableIndexSearch(isEnableIndexSearch()); objectDefinitionImpl.setEnableLocalization(isEnableLocalization()); objectDefinitionImpl.setEnableObjectEntryDraft( isEnableObjectEntryDraft()); objectDefinitionImpl.setEnableObjectEntryHistory( isEnableObjectEntryHistory()); objectDefinitionImpl.setLabel(getLabel()); objectDefinitionImpl.setModifiable(isModifiable()); objectDefinitionImpl.setName(getName()); objectDefinitionImpl.setPanelAppOrder(getPanelAppOrder()); objectDefinitionImpl.setPanelCategoryKey(getPanelCategoryKey()); objectDefinitionImpl.setPKObjectFieldDBColumnName( getPKObjectFieldDBColumnName()); objectDefinitionImpl.setPKObjectFieldName(getPKObjectFieldName()); objectDefinitionImpl.setPluralLabel(getPluralLabel()); objectDefinitionImpl.setPortlet(isPortlet()); objectDefinitionImpl.setScope(getScope()); objectDefinitionImpl.setStorageType(getStorageType()); objectDefinitionImpl.setSystem(isSystem()); objectDefinitionImpl.setVersion(getVersion()); objectDefinitionImpl.setStatus(getStatus()); objectDefinitionImpl.resetOriginalValues(); return objectDefinitionImpl; } @Override public ObjectDefinition cloneWithOriginalValues() { ObjectDefinitionImpl objectDefinitionImpl = new ObjectDefinitionImpl(); objectDefinitionImpl.setMvccVersion( this.getColumnOriginalValue("mvccVersion")); objectDefinitionImpl.setUuid( this.getColumnOriginalValue("uuid_")); objectDefinitionImpl.setExternalReferenceCode( this.getColumnOriginalValue("externalReferenceCode")); objectDefinitionImpl.setObjectDefinitionId( this.getColumnOriginalValue("objectDefinitionId")); objectDefinitionImpl.setCompanyId( this.getColumnOriginalValue("companyId")); objectDefinitionImpl.setUserId( this.getColumnOriginalValue("userId")); objectDefinitionImpl.setUserName( this.getColumnOriginalValue("userName")); objectDefinitionImpl.setCreateDate( this.getColumnOriginalValue("createDate")); objectDefinitionImpl.setModifiedDate( this.getColumnOriginalValue("modifiedDate")); objectDefinitionImpl.setAccountEntryRestrictedObjectFieldId( this.getColumnOriginalValue("accountERObjectFieldId")); objectDefinitionImpl.setDescriptionObjectFieldId( this.getColumnOriginalValue("descriptionObjectFieldId")); objectDefinitionImpl.setObjectFolderId( this.getColumnOriginalValue("objectFolderId")); objectDefinitionImpl.setRootObjectDefinitionId( this.getColumnOriginalValue("rootObjectDefinitionId")); objectDefinitionImpl.setTitleObjectFieldId( this.getColumnOriginalValue("titleObjectFieldId")); objectDefinitionImpl.setAccountEntryRestricted( this.getColumnOriginalValue("accountEntryRestricted")); objectDefinitionImpl.setActive( this.getColumnOriginalValue("active_")); objectDefinitionImpl.setClassName( this.getColumnOriginalValue("className")); objectDefinitionImpl.setDBTableName( this.getColumnOriginalValue("dbTableName")); objectDefinitionImpl.setEnableCategorization( this.getColumnOriginalValue("enableCategorization")); objectDefinitionImpl.setEnableComments( this.getColumnOriginalValue("enableComments")); objectDefinitionImpl.setEnableIndexSearch( this.getColumnOriginalValue("enableIndexSearch")); objectDefinitionImpl.setEnableLocalization( this.getColumnOriginalValue("enableLocalization")); objectDefinitionImpl.setEnableObjectEntryDraft( this.getColumnOriginalValue("enableObjectEntryDraft")); objectDefinitionImpl.setEnableObjectEntryHistory( this.getColumnOriginalValue("enableObjectEntryHistory")); objectDefinitionImpl.setLabel( this.getColumnOriginalValue("label")); objectDefinitionImpl.setModifiable( this.getColumnOriginalValue("modifiable")); objectDefinitionImpl.setName( this.getColumnOriginalValue("name")); objectDefinitionImpl.setPanelAppOrder( this.getColumnOriginalValue("panelAppOrder")); objectDefinitionImpl.setPanelCategoryKey( this.getColumnOriginalValue("panelCategoryKey")); objectDefinitionImpl.setPKObjectFieldDBColumnName( this.getColumnOriginalValue("pkObjectFieldDBColumnName")); objectDefinitionImpl.setPKObjectFieldName( this.getColumnOriginalValue("pkObjectFieldName")); objectDefinitionImpl.setPluralLabel( this.getColumnOriginalValue("pluralLabel")); objectDefinitionImpl.setPortlet( this.getColumnOriginalValue("portlet")); objectDefinitionImpl.setScope( this.getColumnOriginalValue("scope")); objectDefinitionImpl.setStorageType( this.getColumnOriginalValue("storageType")); objectDefinitionImpl.setSystem( this.getColumnOriginalValue("system_")); objectDefinitionImpl.setVersion( this.getColumnOriginalValue("version")); objectDefinitionImpl.setStatus( this.getColumnOriginalValue("status")); return objectDefinitionImpl; } @Override public int compareTo(ObjectDefinition objectDefinition) { int value = 0; value = getName().compareTo(objectDefinition.getName()); if (value != 0) { return value; } return 0; } @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof ObjectDefinition)) { return false; } ObjectDefinition objectDefinition = (ObjectDefinition)object; long primaryKey = objectDefinition.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } } @Override public int hashCode() { return (int)getPrimaryKey(); } /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated @Override public boolean isEntityCacheEnabled() { return true; } /** * @deprecated As of Athanasius (7.3.x), with no direct replacement */ @Deprecated @Override public boolean isFinderCacheEnabled() { return true; } @Override public void resetOriginalValues() { _columnOriginalValues = Collections.emptyMap(); _setModifiedDate = false; _columnBitmask = 0; } @Override public CacheModel toCacheModel() { ObjectDefinitionCacheModel objectDefinitionCacheModel = new ObjectDefinitionCacheModel(); objectDefinitionCacheModel.mvccVersion = getMvccVersion(); objectDefinitionCacheModel.uuid = getUuid(); String uuid = objectDefinitionCacheModel.uuid; if ((uuid != null) && (uuid.length() == 0)) { objectDefinitionCacheModel.uuid = null; } objectDefinitionCacheModel.externalReferenceCode = getExternalReferenceCode(); String externalReferenceCode = objectDefinitionCacheModel.externalReferenceCode; if ((externalReferenceCode != null) && (externalReferenceCode.length() == 0)) { objectDefinitionCacheModel.externalReferenceCode = null; } objectDefinitionCacheModel.objectDefinitionId = getObjectDefinitionId(); objectDefinitionCacheModel.companyId = getCompanyId(); objectDefinitionCacheModel.userId = getUserId(); objectDefinitionCacheModel.userName = getUserName(); String userName = objectDefinitionCacheModel.userName; if ((userName != null) && (userName.length() == 0)) { objectDefinitionCacheModel.userName = null; } Date createDate = getCreateDate(); if (createDate != null) { objectDefinitionCacheModel.createDate = createDate.getTime(); } else { objectDefinitionCacheModel.createDate = Long.MIN_VALUE; } Date modifiedDate = getModifiedDate(); if (modifiedDate != null) { objectDefinitionCacheModel.modifiedDate = modifiedDate.getTime(); } else { objectDefinitionCacheModel.modifiedDate = Long.MIN_VALUE; } objectDefinitionCacheModel.accountEntryRestrictedObjectFieldId = getAccountEntryRestrictedObjectFieldId(); objectDefinitionCacheModel.descriptionObjectFieldId = getDescriptionObjectFieldId(); objectDefinitionCacheModel.objectFolderId = getObjectFolderId(); objectDefinitionCacheModel.rootObjectDefinitionId = getRootObjectDefinitionId(); objectDefinitionCacheModel.titleObjectFieldId = getTitleObjectFieldId(); objectDefinitionCacheModel.accountEntryRestricted = isAccountEntryRestricted(); objectDefinitionCacheModel.active = isActive(); objectDefinitionCacheModel.className = getClassName(); String className = objectDefinitionCacheModel.className; if ((className != null) && (className.length() == 0)) { objectDefinitionCacheModel.className = null; } objectDefinitionCacheModel.dbTableName = getDBTableName(); String dbTableName = objectDefinitionCacheModel.dbTableName; if ((dbTableName != null) && (dbTableName.length() == 0)) { objectDefinitionCacheModel.dbTableName = null; } objectDefinitionCacheModel.enableCategorization = isEnableCategorization(); objectDefinitionCacheModel.enableComments = isEnableComments(); objectDefinitionCacheModel.enableIndexSearch = isEnableIndexSearch(); objectDefinitionCacheModel.enableLocalization = isEnableLocalization(); objectDefinitionCacheModel.enableObjectEntryDraft = isEnableObjectEntryDraft(); objectDefinitionCacheModel.enableObjectEntryHistory = isEnableObjectEntryHistory(); objectDefinitionCacheModel.label = getLabel(); String label = objectDefinitionCacheModel.label; if ((label != null) && (label.length() == 0)) { objectDefinitionCacheModel.label = null; } objectDefinitionCacheModel.modifiable = isModifiable(); objectDefinitionCacheModel.name = getName(); String name = objectDefinitionCacheModel.name; if ((name != null) && (name.length() == 0)) { objectDefinitionCacheModel.name = null; } objectDefinitionCacheModel.panelAppOrder = getPanelAppOrder(); String panelAppOrder = objectDefinitionCacheModel.panelAppOrder; if ((panelAppOrder != null) && (panelAppOrder.length() == 0)) { objectDefinitionCacheModel.panelAppOrder = null; } objectDefinitionCacheModel.panelCategoryKey = getPanelCategoryKey(); String panelCategoryKey = objectDefinitionCacheModel.panelCategoryKey; if ((panelCategoryKey != null) && (panelCategoryKey.length() == 0)) { objectDefinitionCacheModel.panelCategoryKey = null; } objectDefinitionCacheModel.pkObjectFieldDBColumnName = getPKObjectFieldDBColumnName(); String pkObjectFieldDBColumnName = objectDefinitionCacheModel.pkObjectFieldDBColumnName; if ((pkObjectFieldDBColumnName != null) && (pkObjectFieldDBColumnName.length() == 0)) { objectDefinitionCacheModel.pkObjectFieldDBColumnName = null; } objectDefinitionCacheModel.pkObjectFieldName = getPKObjectFieldName(); String pkObjectFieldName = objectDefinitionCacheModel.pkObjectFieldName; if ((pkObjectFieldName != null) && (pkObjectFieldName.length() == 0)) { objectDefinitionCacheModel.pkObjectFieldName = null; } objectDefinitionCacheModel.pluralLabel = getPluralLabel(); String pluralLabel = objectDefinitionCacheModel.pluralLabel; if ((pluralLabel != null) && (pluralLabel.length() == 0)) { objectDefinitionCacheModel.pluralLabel = null; } objectDefinitionCacheModel.portlet = isPortlet(); objectDefinitionCacheModel.scope = getScope(); String scope = objectDefinitionCacheModel.scope; if ((scope != null) && (scope.length() == 0)) { objectDefinitionCacheModel.scope = null; } objectDefinitionCacheModel.storageType = getStorageType(); String storageType = objectDefinitionCacheModel.storageType; if ((storageType != null) && (storageType.length() == 0)) { objectDefinitionCacheModel.storageType = null; } objectDefinitionCacheModel.system = isSystem(); objectDefinitionCacheModel.version = getVersion(); objectDefinitionCacheModel.status = getStatus(); return objectDefinitionCacheModel; } @Override public String toString() { Map> attributeGetterFunctions = getAttributeGetterFunctions(); StringBundler sb = new StringBundler( (5 * attributeGetterFunctions.size()) + 2); sb.append("{"); for (Map.Entry> entry : attributeGetterFunctions.entrySet()) { String attributeName = entry.getKey(); Function attributeGetterFunction = entry.getValue(); sb.append("\""); sb.append(attributeName); sb.append("\": "); Object value = attributeGetterFunction.apply( (ObjectDefinition)this); if (value == null) { sb.append("null"); } else if (value instanceof Blob || value instanceof Date || value instanceof Map || value instanceof String) { sb.append( "\"" + StringUtil.replace(value.toString(), "\"", "'") + "\""); } else { sb.append(value); } sb.append(", "); } if (sb.index() > 1) { sb.setIndex(sb.index() - 1); } sb.append("}"); return sb.toString(); } private static class EscapedModelProxyProviderFunctionHolder { private static final Function _escapedModelProxyProviderFunction = ProxyUtil.getProxyProviderFunction( ObjectDefinition.class, ModelWrapper.class); } private long _mvccVersion; private String _uuid; private String _externalReferenceCode; private long _objectDefinitionId; private long _companyId; private long _userId; private String _userName; private Date _createDate; private Date _modifiedDate; private boolean _setModifiedDate; private long _accountEntryRestrictedObjectFieldId; private long _descriptionObjectFieldId; private long _objectFolderId; private long _rootObjectDefinitionId; private long _titleObjectFieldId; private boolean _accountEntryRestricted; private boolean _active; private String _className; private String _dbTableName; private boolean _enableCategorization; private boolean _enableComments; private boolean _enableIndexSearch; private boolean _enableLocalization; private boolean _enableObjectEntryDraft; private boolean _enableObjectEntryHistory; private String _label; private String _labelCurrentLanguageId; private boolean _modifiable; private String _name; private String _panelAppOrder; private String _panelCategoryKey; private String _pkObjectFieldDBColumnName; private String _pkObjectFieldName; private String _pluralLabel; private String _pluralLabelCurrentLanguageId; private boolean _portlet; private String _scope; private String _storageType; private boolean _system; private int _version; private int _status; public T getColumnValue(String columnName) { columnName = _attributeNames.getOrDefault(columnName, columnName); Function function = AttributeGetterFunctionsHolder._attributeGetterFunctions.get( columnName); if (function == null) { throw new IllegalArgumentException( "No attribute getter function found for " + columnName); } return (T)function.apply((ObjectDefinition)this); } public T getColumnOriginalValue(String columnName) { if (_columnOriginalValues == null) { return null; } if (_columnOriginalValues == Collections.EMPTY_MAP) { _setColumnOriginalValues(); } return (T)_columnOriginalValues.get(columnName); } private void _setColumnOriginalValues() { _columnOriginalValues = new HashMap(); _columnOriginalValues.put("mvccVersion", _mvccVersion); _columnOriginalValues.put("uuid_", _uuid); _columnOriginalValues.put( "externalReferenceCode", _externalReferenceCode); _columnOriginalValues.put("objectDefinitionId", _objectDefinitionId); _columnOriginalValues.put("companyId", _companyId); _columnOriginalValues.put("userId", _userId); _columnOriginalValues.put("userName", _userName); _columnOriginalValues.put("createDate", _createDate); _columnOriginalValues.put("modifiedDate", _modifiedDate); _columnOriginalValues.put( "accountERObjectFieldId", _accountEntryRestrictedObjectFieldId); _columnOriginalValues.put( "descriptionObjectFieldId", _descriptionObjectFieldId); _columnOriginalValues.put("objectFolderId", _objectFolderId); _columnOriginalValues.put( "rootObjectDefinitionId", _rootObjectDefinitionId); _columnOriginalValues.put("titleObjectFieldId", _titleObjectFieldId); _columnOriginalValues.put( "accountEntryRestricted", _accountEntryRestricted); _columnOriginalValues.put("active_", _active); _columnOriginalValues.put("className", _className); _columnOriginalValues.put("dbTableName", _dbTableName); _columnOriginalValues.put( "enableCategorization", _enableCategorization); _columnOriginalValues.put("enableComments", _enableComments); _columnOriginalValues.put("enableIndexSearch", _enableIndexSearch); _columnOriginalValues.put("enableLocalization", _enableLocalization); _columnOriginalValues.put( "enableObjectEntryDraft", _enableObjectEntryDraft); _columnOriginalValues.put( "enableObjectEntryHistory", _enableObjectEntryHistory); _columnOriginalValues.put("label", _label); _columnOriginalValues.put("modifiable", _modifiable); _columnOriginalValues.put("name", _name); _columnOriginalValues.put("panelAppOrder", _panelAppOrder); _columnOriginalValues.put("panelCategoryKey", _panelCategoryKey); _columnOriginalValues.put( "pkObjectFieldDBColumnName", _pkObjectFieldDBColumnName); _columnOriginalValues.put("pkObjectFieldName", _pkObjectFieldName); _columnOriginalValues.put("pluralLabel", _pluralLabel); _columnOriginalValues.put("portlet", _portlet); _columnOriginalValues.put("scope", _scope); _columnOriginalValues.put("storageType", _storageType); _columnOriginalValues.put("system_", _system); _columnOriginalValues.put("version", _version); _columnOriginalValues.put("status", _status); } private static final Map _attributeNames; static { Map attributeNames = new HashMap<>(); attributeNames.put("uuid_", "uuid"); attributeNames.put( "accountERObjectFieldId", "accountEntryRestrictedObjectFieldId"); attributeNames.put("active_", "active"); attributeNames.put("system_", "system"); _attributeNames = Collections.unmodifiableMap(attributeNames); } private transient Map _columnOriginalValues; public static long getColumnBitmask(String columnName) { return _columnBitmasks.get(columnName); } private static final Map _columnBitmasks; static { Map columnBitmasks = new HashMap<>(); columnBitmasks.put("mvccVersion", 1L); columnBitmasks.put("uuid_", 2L); columnBitmasks.put("externalReferenceCode", 4L); columnBitmasks.put("objectDefinitionId", 8L); columnBitmasks.put("companyId", 16L); columnBitmasks.put("userId", 32L); columnBitmasks.put("userName", 64L); columnBitmasks.put("createDate", 128L); columnBitmasks.put("modifiedDate", 256L); columnBitmasks.put("accountERObjectFieldId", 512L); columnBitmasks.put("descriptionObjectFieldId", 1024L); columnBitmasks.put("objectFolderId", 2048L); columnBitmasks.put("rootObjectDefinitionId", 4096L); columnBitmasks.put("titleObjectFieldId", 8192L); columnBitmasks.put("accountEntryRestricted", 16384L); columnBitmasks.put("active_", 32768L); columnBitmasks.put("className", 65536L); columnBitmasks.put("dbTableName", 131072L); columnBitmasks.put("enableCategorization", 262144L); columnBitmasks.put("enableComments", 524288L); columnBitmasks.put("enableIndexSearch", 1048576L); columnBitmasks.put("enableLocalization", 2097152L); columnBitmasks.put("enableObjectEntryDraft", 4194304L); columnBitmasks.put("enableObjectEntryHistory", 8388608L); columnBitmasks.put("label", 16777216L); columnBitmasks.put("modifiable", 33554432L); columnBitmasks.put("name", 67108864L); columnBitmasks.put("panelAppOrder", 134217728L); columnBitmasks.put("panelCategoryKey", 268435456L); columnBitmasks.put("pkObjectFieldDBColumnName", 536870912L); columnBitmasks.put("pkObjectFieldName", 1073741824L); columnBitmasks.put("pluralLabel", 2147483648L); columnBitmasks.put("portlet", 4294967296L); columnBitmasks.put("scope", 8589934592L); columnBitmasks.put("storageType", 17179869184L); columnBitmasks.put("system_", 34359738368L); columnBitmasks.put("version", 68719476736L); columnBitmasks.put("status", 137438953472L); _columnBitmasks = Collections.unmodifiableMap(columnBitmasks); } private long _columnBitmask; private ObjectDefinition _escapedModel; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy