com.liferay.dynamic.data.mapping.model.impl.DDMStorageLinkModelImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.dynamic.data.mapping.service Show documentation
Show all versions of com.liferay.dynamic.data.mapping.service Show documentation
Liferay Dynamic Data Mapping Service
/**
* 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.dynamic.data.mapping.model.impl;
import com.liferay.dynamic.data.mapping.model.DDMStorageLink;
import com.liferay.dynamic.data.mapping.model.DDMStorageLinkModel;
import com.liferay.expando.kernel.model.ExpandoBridge;
import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
import com.liferay.petra.string.StringBundler;
import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.model.CacheModel;
import com.liferay.portal.kernel.model.ModelWrapper;
import com.liferay.portal.kernel.model.impl.BaseModelImpl;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.Validator;
import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.sql.Types;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Function;
/**
* The base model implementation for the DDMStorageLink service. Represents a row in the "DDMStorageLink" database table, with each column mapped to a property of this class.
*
*
* This implementation and its corresponding interface DDMStorageLinkModel
exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link DDMStorageLinkImpl}.
*
*
* @author Brian Wing Shun Chan
* @see DDMStorageLinkImpl
* @generated
*/
public class DDMStorageLinkModelImpl
extends BaseModelImpl implements DDMStorageLinkModel {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. All methods that expect a ddm storage link model instance should use the DDMStorageLink
interface instead.
*/
public static final String TABLE_NAME = "DDMStorageLink";
public static final Object[][] TABLE_COLUMNS = {
{"mvccVersion", Types.BIGINT}, {"uuid_", Types.VARCHAR},
{"storageLinkId", Types.BIGINT}, {"companyId", Types.BIGINT},
{"classNameId", Types.BIGINT}, {"classPK", Types.BIGINT},
{"structureId", Types.BIGINT}, {"structureVersionId", Types.BIGINT}
};
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("storageLinkId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("companyId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("classNameId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("classPK", Types.BIGINT);
TABLE_COLUMNS_MAP.put("structureId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("structureVersionId", Types.BIGINT);
}
public static final String TABLE_SQL_CREATE =
"create table DDMStorageLink (mvccVersion LONG default 0 not null,uuid_ VARCHAR(75) null,storageLinkId LONG not null primary key,companyId LONG,classNameId LONG,classPK LONG,structureId LONG,structureVersionId LONG)";
public static final String TABLE_SQL_DROP = "drop table DDMStorageLink";
public static final String ORDER_BY_JPQL =
" ORDER BY ddmStorageLink.storageLinkId ASC";
public static final String ORDER_BY_SQL =
" ORDER BY DDMStorageLink.storageLinkId ASC";
public static final String DATA_SOURCE = "liferayDataSource";
public static final String SESSION_FACTORY = "liferaySessionFactory";
public static final String TX_MANAGER = "liferayTransactionManager";
public static final long CLASSPK_COLUMN_BITMASK = 1L;
public static final long COMPANYID_COLUMN_BITMASK = 2L;
public static final long STRUCTUREID_COLUMN_BITMASK = 4L;
public static final long STRUCTUREVERSIONID_COLUMN_BITMASK = 8L;
public static final long UUID_COLUMN_BITMASK = 16L;
public static final long STORAGELINKID_COLUMN_BITMASK = 32L;
public static void setEntityCacheEnabled(boolean entityCacheEnabled) {
_entityCacheEnabled = entityCacheEnabled;
}
public static void setFinderCacheEnabled(boolean finderCacheEnabled) {
_finderCacheEnabled = finderCacheEnabled;
}
public DDMStorageLinkModelImpl() {
}
@Override
public long getPrimaryKey() {
return _storageLinkId;
}
@Override
public void setPrimaryKey(long primaryKey) {
setStorageLinkId(primaryKey);
}
@Override
public Serializable getPrimaryKeyObj() {
return _storageLinkId;
}
@Override
public void setPrimaryKeyObj(Serializable primaryKeyObj) {
setPrimaryKey(((Long)primaryKeyObj).longValue());
}
@Override
public Class> getModelClass() {
return DDMStorageLink.class;
}
@Override
public String getModelClassName() {
return DDMStorageLink.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((DDMStorageLink)this));
}
attributes.put("entityCacheEnabled", isEntityCacheEnabled());
attributes.put("finderCacheEnabled", isFinderCacheEnabled());
return attributes;
}
@Override
public void setModelAttributes(Map attributes) {
Map>
attributeSetterBiConsumers = getAttributeSetterBiConsumers();
for (Map.Entry entry : attributes.entrySet()) {
String attributeName = entry.getKey();
BiConsumer attributeSetterBiConsumer =
attributeSetterBiConsumers.get(attributeName);
if (attributeSetterBiConsumer != null) {
attributeSetterBiConsumer.accept(
(DDMStorageLink)this, entry.getValue());
}
}
}
public Map>
getAttributeGetterFunctions() {
return _attributeGetterFunctions;
}
public Map>
getAttributeSetterBiConsumers() {
return _attributeSetterBiConsumers;
}
private static Function
_getProxyProviderFunction() {
Class> proxyClass = ProxyUtil.getProxyClass(
DDMStorageLink.class.getClassLoader(), DDMStorageLink.class,
ModelWrapper.class);
try {
Constructor constructor =
(Constructor)proxyClass.getConstructor(
InvocationHandler.class);
return invocationHandler -> {
try {
return constructor.newInstance(invocationHandler);
}
catch (ReflectiveOperationException
reflectiveOperationException) {
throw new InternalError(reflectiveOperationException);
}
};
}
catch (NoSuchMethodException noSuchMethodException) {
throw new InternalError(noSuchMethodException);
}
}
private static final Map>
_attributeGetterFunctions;
private static final Map>
_attributeSetterBiConsumers;
static {
Map> attributeGetterFunctions =
new LinkedHashMap>();
Map> attributeSetterBiConsumers =
new LinkedHashMap>();
attributeGetterFunctions.put(
"mvccVersion", DDMStorageLink::getMvccVersion);
attributeSetterBiConsumers.put(
"mvccVersion",
(BiConsumer)DDMStorageLink::setMvccVersion);
attributeGetterFunctions.put("uuid", DDMStorageLink::getUuid);
attributeSetterBiConsumers.put(
"uuid",
(BiConsumer)DDMStorageLink::setUuid);
attributeGetterFunctions.put(
"storageLinkId", DDMStorageLink::getStorageLinkId);
attributeSetterBiConsumers.put(
"storageLinkId",
(BiConsumer)DDMStorageLink::setStorageLinkId);
attributeGetterFunctions.put("companyId", DDMStorageLink::getCompanyId);
attributeSetterBiConsumers.put(
"companyId",
(BiConsumer)DDMStorageLink::setCompanyId);
attributeGetterFunctions.put(
"classNameId", DDMStorageLink::getClassNameId);
attributeSetterBiConsumers.put(
"classNameId",
(BiConsumer)DDMStorageLink::setClassNameId);
attributeGetterFunctions.put("classPK", DDMStorageLink::getClassPK);
attributeSetterBiConsumers.put(
"classPK",
(BiConsumer)DDMStorageLink::setClassPK);
attributeGetterFunctions.put(
"structureId", DDMStorageLink::getStructureId);
attributeSetterBiConsumers.put(
"structureId",
(BiConsumer)DDMStorageLink::setStructureId);
attributeGetterFunctions.put(
"structureVersionId", DDMStorageLink::getStructureVersionId);
attributeSetterBiConsumers.put(
"structureVersionId",
(BiConsumer)
DDMStorageLink::setStructureVersionId);
_attributeGetterFunctions = Collections.unmodifiableMap(
attributeGetterFunctions);
_attributeSetterBiConsumers = Collections.unmodifiableMap(
(Map)attributeSetterBiConsumers);
}
@Override
public long getMvccVersion() {
return _mvccVersion;
}
@Override
public void setMvccVersion(long mvccVersion) {
_mvccVersion = mvccVersion;
}
@Override
public String getUuid() {
if (_uuid == null) {
return "";
}
else {
return _uuid;
}
}
@Override
public void setUuid(String uuid) {
_columnBitmask |= UUID_COLUMN_BITMASK;
if (_originalUuid == null) {
_originalUuid = _uuid;
}
_uuid = uuid;
}
public String getOriginalUuid() {
return GetterUtil.getString(_originalUuid);
}
@Override
public long getStorageLinkId() {
return _storageLinkId;
}
@Override
public void setStorageLinkId(long storageLinkId) {
_storageLinkId = storageLinkId;
}
@Override
public long getCompanyId() {
return _companyId;
}
@Override
public void setCompanyId(long companyId) {
_columnBitmask |= COMPANYID_COLUMN_BITMASK;
if (!_setOriginalCompanyId) {
_setOriginalCompanyId = true;
_originalCompanyId = _companyId;
}
_companyId = companyId;
}
public long getOriginalCompanyId() {
return _originalCompanyId;
}
@Override
public String getClassName() {
if (getClassNameId() <= 0) {
return "";
}
return PortalUtil.getClassName(getClassNameId());
}
@Override
public void setClassName(String className) {
long classNameId = 0;
if (Validator.isNotNull(className)) {
classNameId = PortalUtil.getClassNameId(className);
}
setClassNameId(classNameId);
}
@Override
public long getClassNameId() {
return _classNameId;
}
@Override
public void setClassNameId(long classNameId) {
_classNameId = classNameId;
}
@Override
public long getClassPK() {
return _classPK;
}
@Override
public void setClassPK(long classPK) {
_columnBitmask |= CLASSPK_COLUMN_BITMASK;
if (!_setOriginalClassPK) {
_setOriginalClassPK = true;
_originalClassPK = _classPK;
}
_classPK = classPK;
}
public long getOriginalClassPK() {
return _originalClassPK;
}
@Override
public long getStructureId() {
return _structureId;
}
@Override
public void setStructureId(long structureId) {
_columnBitmask |= STRUCTUREID_COLUMN_BITMASK;
if (!_setOriginalStructureId) {
_setOriginalStructureId = true;
_originalStructureId = _structureId;
}
_structureId = structureId;
}
public long getOriginalStructureId() {
return _originalStructureId;
}
@Override
public long getStructureVersionId() {
return _structureVersionId;
}
@Override
public void setStructureVersionId(long structureVersionId) {
_columnBitmask |= STRUCTUREVERSIONID_COLUMN_BITMASK;
if (!_setOriginalStructureVersionId) {
_setOriginalStructureVersionId = true;
_originalStructureVersionId = _structureVersionId;
}
_structureVersionId = structureVersionId;
}
public long getOriginalStructureVersionId() {
return _originalStructureVersionId;
}
public long getColumnBitmask() {
return _columnBitmask;
}
@Override
public ExpandoBridge getExpandoBridge() {
return ExpandoBridgeFactoryUtil.getExpandoBridge(
getCompanyId(), DDMStorageLink.class.getName(), getPrimaryKey());
}
@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
ExpandoBridge expandoBridge = getExpandoBridge();
expandoBridge.setAttributes(serviceContext);
}
@Override
public DDMStorageLink toEscapedModel() {
if (_escapedModel == null) {
Function
escapedModelProxyProviderFunction =
EscapedModelProxyProviderFunctionHolder.
_escapedModelProxyProviderFunction;
_escapedModel = escapedModelProxyProviderFunction.apply(
new AutoEscapeBeanHandler(this));
}
return _escapedModel;
}
@Override
public Object clone() {
DDMStorageLinkImpl ddmStorageLinkImpl = new DDMStorageLinkImpl();
ddmStorageLinkImpl.setMvccVersion(getMvccVersion());
ddmStorageLinkImpl.setUuid(getUuid());
ddmStorageLinkImpl.setStorageLinkId(getStorageLinkId());
ddmStorageLinkImpl.setCompanyId(getCompanyId());
ddmStorageLinkImpl.setClassNameId(getClassNameId());
ddmStorageLinkImpl.setClassPK(getClassPK());
ddmStorageLinkImpl.setStructureId(getStructureId());
ddmStorageLinkImpl.setStructureVersionId(getStructureVersionId());
ddmStorageLinkImpl.resetOriginalValues();
return ddmStorageLinkImpl;
}
@Override
public int compareTo(DDMStorageLink ddmStorageLink) {
long primaryKey = ddmStorageLink.getPrimaryKey();
if (getPrimaryKey() < primaryKey) {
return -1;
}
else if (getPrimaryKey() > primaryKey) {
return 1;
}
else {
return 0;
}
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof DDMStorageLink)) {
return false;
}
DDMStorageLink ddmStorageLink = (DDMStorageLink)obj;
long primaryKey = ddmStorageLink.getPrimaryKey();
if (getPrimaryKey() == primaryKey) {
return true;
}
else {
return false;
}
}
@Override
public int hashCode() {
return (int)getPrimaryKey();
}
@Override
public boolean isEntityCacheEnabled() {
return _entityCacheEnabled;
}
@Override
public boolean isFinderCacheEnabled() {
return _finderCacheEnabled;
}
@Override
public void resetOriginalValues() {
DDMStorageLinkModelImpl ddmStorageLinkModelImpl = this;
ddmStorageLinkModelImpl._originalUuid = ddmStorageLinkModelImpl._uuid;
ddmStorageLinkModelImpl._originalCompanyId =
ddmStorageLinkModelImpl._companyId;
ddmStorageLinkModelImpl._setOriginalCompanyId = false;
ddmStorageLinkModelImpl._originalClassPK =
ddmStorageLinkModelImpl._classPK;
ddmStorageLinkModelImpl._setOriginalClassPK = false;
ddmStorageLinkModelImpl._originalStructureId =
ddmStorageLinkModelImpl._structureId;
ddmStorageLinkModelImpl._setOriginalStructureId = false;
ddmStorageLinkModelImpl._originalStructureVersionId =
ddmStorageLinkModelImpl._structureVersionId;
ddmStorageLinkModelImpl._setOriginalStructureVersionId = false;
ddmStorageLinkModelImpl._columnBitmask = 0;
}
@Override
public CacheModel toCacheModel() {
DDMStorageLinkCacheModel ddmStorageLinkCacheModel =
new DDMStorageLinkCacheModel();
ddmStorageLinkCacheModel.mvccVersion = getMvccVersion();
ddmStorageLinkCacheModel.uuid = getUuid();
String uuid = ddmStorageLinkCacheModel.uuid;
if ((uuid != null) && (uuid.length() == 0)) {
ddmStorageLinkCacheModel.uuid = null;
}
ddmStorageLinkCacheModel.storageLinkId = getStorageLinkId();
ddmStorageLinkCacheModel.companyId = getCompanyId();
ddmStorageLinkCacheModel.classNameId = getClassNameId();
ddmStorageLinkCacheModel.classPK = getClassPK();
ddmStorageLinkCacheModel.structureId = getStructureId();
ddmStorageLinkCacheModel.structureVersionId = getStructureVersionId();
return ddmStorageLinkCacheModel;
}
@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((DDMStorageLink)this));
sb.append(", ");
}
if (sb.index() > 1) {
sb.setIndex(sb.index() - 1);
}
sb.append("}");
return sb.toString();
}
@Override
public String toXmlString() {
Map> attributeGetterFunctions =
getAttributeGetterFunctions();
StringBundler sb = new StringBundler(
5 * attributeGetterFunctions.size() + 4);
sb.append("");
sb.append(getModelClassName());
sb.append(" ");
for (Map.Entry> entry :
attributeGetterFunctions.entrySet()) {
String attributeName = entry.getKey();
Function attributeGetterFunction =
entry.getValue();
sb.append("");
sb.append(attributeName);
sb.append(" ");
}
sb.append(" ");
return sb.toString();
}
private static class EscapedModelProxyProviderFunctionHolder {
private static final Function
_escapedModelProxyProviderFunction = _getProxyProviderFunction();
}
private static boolean _entityCacheEnabled;
private static boolean _finderCacheEnabled;
private long _mvccVersion;
private String _uuid;
private String _originalUuid;
private long _storageLinkId;
private long _companyId;
private long _originalCompanyId;
private boolean _setOriginalCompanyId;
private long _classNameId;
private long _classPK;
private long _originalClassPK;
private boolean _setOriginalClassPK;
private long _structureId;
private long _originalStructureId;
private boolean _setOriginalStructureId;
private long _structureVersionId;
private long _originalStructureVersionId;
private boolean _setOriginalStructureVersionId;
private long _columnBitmask;
private DDMStorageLink _escapedModel;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy