
com.liferay.commerce.product.model.impl.CPAttachmentFileEntryModelImpl Maven / Gradle / Ivy
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.commerce.product.model.impl;
import aQute.bnd.annotation.ProviderType;
import com.liferay.commerce.product.model.CPAttachmentFileEntry;
import com.liferay.commerce.product.model.CPAttachmentFileEntryModel;
import com.liferay.commerce.product.model.CPAttachmentFileEntrySoap;
import com.liferay.expando.kernel.model.ExpandoBridge;
import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
import com.liferay.exportimport.kernel.lar.StagedModelType;
import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.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.StringBundler;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import java.io.Serializable;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
/**
* The base model implementation for the CPAttachmentFileEntry service. Represents a row in the "CPAttachmentFileEntry" database table, with each column mapped to a property of this class.
*
*
* This implementation and its corresponding interface {@link CPAttachmentFileEntryModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CPAttachmentFileEntryImpl}.
*
*
* @author Marco Leo
* @see CPAttachmentFileEntryImpl
* @see CPAttachmentFileEntry
* @see CPAttachmentFileEntryModel
* @generated
*/
@JSON(strict = true)
@ProviderType
public class CPAttachmentFileEntryModelImpl extends BaseModelImpl
implements CPAttachmentFileEntryModel {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. All methods that expect a cp attachment file entry model instance should use the {@link CPAttachmentFileEntry} interface instead.
*/
public static final String TABLE_NAME = "CPAttachmentFileEntry";
public static final Object[][] TABLE_COLUMNS = {
{ "uuid_", Types.VARCHAR },
{ "externalReferenceCode", Types.VARCHAR },
{ "CPAttachmentFileEntryId", Types.BIGINT },
{ "groupId", Types.BIGINT },
{ "companyId", Types.BIGINT },
{ "userId", Types.BIGINT },
{ "userName", Types.VARCHAR },
{ "createDate", Types.TIMESTAMP },
{ "modifiedDate", Types.TIMESTAMP },
{ "classNameId", Types.BIGINT },
{ "classPK", Types.BIGINT },
{ "fileEntryId", Types.BIGINT },
{ "displayDate", Types.TIMESTAMP },
{ "expirationDate", Types.TIMESTAMP },
{ "title", Types.VARCHAR },
{ "json", Types.CLOB },
{ "priority", Types.DOUBLE },
{ "type_", Types.INTEGER },
{ "lastPublishDate", Types.TIMESTAMP },
{ "status", Types.INTEGER },
{ "statusByUserId", Types.BIGINT },
{ "statusByUserName", Types.VARCHAR },
{ "statusDate", Types.TIMESTAMP }
};
public static final Map TABLE_COLUMNS_MAP = new HashMap();
static {
TABLE_COLUMNS_MAP.put("uuid_", Types.VARCHAR);
TABLE_COLUMNS_MAP.put("externalReferenceCode", Types.VARCHAR);
TABLE_COLUMNS_MAP.put("CPAttachmentFileEntryId", 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("classNameId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("classPK", Types.BIGINT);
TABLE_COLUMNS_MAP.put("fileEntryId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("displayDate", Types.TIMESTAMP);
TABLE_COLUMNS_MAP.put("expirationDate", Types.TIMESTAMP);
TABLE_COLUMNS_MAP.put("title", Types.VARCHAR);
TABLE_COLUMNS_MAP.put("json", Types.CLOB);
TABLE_COLUMNS_MAP.put("priority", Types.DOUBLE);
TABLE_COLUMNS_MAP.put("type_", Types.INTEGER);
TABLE_COLUMNS_MAP.put("lastPublishDate", Types.TIMESTAMP);
TABLE_COLUMNS_MAP.put("status", Types.INTEGER);
TABLE_COLUMNS_MAP.put("statusByUserId", Types.BIGINT);
TABLE_COLUMNS_MAP.put("statusByUserName", Types.VARCHAR);
TABLE_COLUMNS_MAP.put("statusDate", Types.TIMESTAMP);
}
public static final String TABLE_SQL_CREATE = "create table CPAttachmentFileEntry (uuid_ VARCHAR(75) null,externalReferenceCode VARCHAR(75) null,CPAttachmentFileEntryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,classNameId LONG,classPK LONG,fileEntryId LONG,displayDate DATE null,expirationDate DATE null,title STRING null,json TEXT null,priority DOUBLE,type_ INTEGER,lastPublishDate DATE null,status INTEGER,statusByUserId LONG,statusByUserName VARCHAR(75) null,statusDate DATE null)";
public static final String TABLE_SQL_DROP = "drop table CPAttachmentFileEntry";
public static final String ORDER_BY_JPQL = " ORDER BY cpAttachmentFileEntry.priority ASC";
public static final String ORDER_BY_SQL = " ORDER BY CPAttachmentFileEntry.priority 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 boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.commerce.product.service.util.ServiceProps.get(
"value.object.entity.cache.enabled.com.liferay.commerce.product.model.CPAttachmentFileEntry"),
true);
public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.commerce.product.service.util.ServiceProps.get(
"value.object.finder.cache.enabled.com.liferay.commerce.product.model.CPAttachmentFileEntry"),
true);
public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.commerce.product.service.util.ServiceProps.get(
"value.object.column.bitmask.enabled.com.liferay.commerce.product.model.CPAttachmentFileEntry"),
true);
public static final long CLASSNAMEID_COLUMN_BITMASK = 1L;
public static final long CLASSPK_COLUMN_BITMASK = 2L;
public static final long COMPANYID_COLUMN_BITMASK = 4L;
public static final long DISPLAYDATE_COLUMN_BITMASK = 8L;
public static final long EXTERNALREFERENCECODE_COLUMN_BITMASK = 16L;
public static final long GROUPID_COLUMN_BITMASK = 32L;
public static final long STATUS_COLUMN_BITMASK = 64L;
public static final long TYPE_COLUMN_BITMASK = 128L;
public static final long UUID_COLUMN_BITMASK = 256L;
public static final long PRIORITY_COLUMN_BITMASK = 512L;
/**
* Converts the soap model instance into a normal model instance.
*
* @param soapModel the soap model instance to convert
* @return the normal model instance
*/
public static CPAttachmentFileEntry toModel(
CPAttachmentFileEntrySoap soapModel) {
if (soapModel == null) {
return null;
}
CPAttachmentFileEntry model = new CPAttachmentFileEntryImpl();
model.setUuid(soapModel.getUuid());
model.setExternalReferenceCode(soapModel.getExternalReferenceCode());
model.setCPAttachmentFileEntryId(soapModel.getCPAttachmentFileEntryId());
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.setClassNameId(soapModel.getClassNameId());
model.setClassPK(soapModel.getClassPK());
model.setFileEntryId(soapModel.getFileEntryId());
model.setDisplayDate(soapModel.getDisplayDate());
model.setExpirationDate(soapModel.getExpirationDate());
model.setTitle(soapModel.getTitle());
model.setJson(soapModel.getJson());
model.setPriority(soapModel.getPriority());
model.setType(soapModel.getType());
model.setLastPublishDate(soapModel.getLastPublishDate());
model.setStatus(soapModel.getStatus());
model.setStatusByUserId(soapModel.getStatusByUserId());
model.setStatusByUserName(soapModel.getStatusByUserName());
model.setStatusDate(soapModel.getStatusDate());
return model;
}
/**
* Converts the soap model instances into normal model instances.
*
* @param soapModels the soap model instances to convert
* @return the normal model instances
*/
public static List toModels(
CPAttachmentFileEntrySoap[] soapModels) {
if (soapModels == null) {
return null;
}
List models = new ArrayList(soapModels.length);
for (CPAttachmentFileEntrySoap soapModel : soapModels) {
models.add(toModel(soapModel));
}
return models;
}
public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.commerce.product.service.util.ServiceProps.get(
"lock.expiration.time.com.liferay.commerce.product.model.CPAttachmentFileEntry"));
public CPAttachmentFileEntryModelImpl() {
}
@Override
public long getPrimaryKey() {
return _CPAttachmentFileEntryId;
}
@Override
public void setPrimaryKey(long primaryKey) {
setCPAttachmentFileEntryId(primaryKey);
}
@Override
public Serializable getPrimaryKeyObj() {
return _CPAttachmentFileEntryId;
}
@Override
public void setPrimaryKeyObj(Serializable primaryKeyObj) {
setPrimaryKey(((Long)primaryKeyObj).longValue());
}
@Override
public Class> getModelClass() {
return CPAttachmentFileEntry.class;
}
@Override
public String getModelClassName() {
return CPAttachmentFileEntry.class.getName();
}
@Override
public Map getModelAttributes() {
Map attributes = new HashMap();
attributes.put("uuid", getUuid());
attributes.put("externalReferenceCode", getExternalReferenceCode());
attributes.put("CPAttachmentFileEntryId", getCPAttachmentFileEntryId());
attributes.put("groupId", getGroupId());
attributes.put("companyId", getCompanyId());
attributes.put("userId", getUserId());
attributes.put("userName", getUserName());
attributes.put("createDate", getCreateDate());
attributes.put("modifiedDate", getModifiedDate());
attributes.put("classNameId", getClassNameId());
attributes.put("classPK", getClassPK());
attributes.put("fileEntryId", getFileEntryId());
attributes.put("displayDate", getDisplayDate());
attributes.put("expirationDate", getExpirationDate());
attributes.put("title", getTitle());
attributes.put("json", getJson());
attributes.put("priority", getPriority());
attributes.put("type", getType());
attributes.put("lastPublishDate", getLastPublishDate());
attributes.put("status", getStatus());
attributes.put("statusByUserId", getStatusByUserId());
attributes.put("statusByUserName", getStatusByUserName());
attributes.put("statusDate", getStatusDate());
attributes.put("entityCacheEnabled", isEntityCacheEnabled());
attributes.put("finderCacheEnabled", isFinderCacheEnabled());
return attributes;
}
@Override
public void setModelAttributes(Map attributes) {
String uuid = (String)attributes.get("uuid");
if (uuid != null) {
setUuid(uuid);
}
String externalReferenceCode = (String)attributes.get(
"externalReferenceCode");
if (externalReferenceCode != null) {
setExternalReferenceCode(externalReferenceCode);
}
Long CPAttachmentFileEntryId = (Long)attributes.get(
"CPAttachmentFileEntryId");
if (CPAttachmentFileEntryId != null) {
setCPAttachmentFileEntryId(CPAttachmentFileEntryId);
}
Long groupId = (Long)attributes.get("groupId");
if (groupId != null) {
setGroupId(groupId);
}
Long companyId = (Long)attributes.get("companyId");
if (companyId != null) {
setCompanyId(companyId);
}
Long userId = (Long)attributes.get("userId");
if (userId != null) {
setUserId(userId);
}
String userName = (String)attributes.get("userName");
if (userName != null) {
setUserName(userName);
}
Date createDate = (Date)attributes.get("createDate");
if (createDate != null) {
setCreateDate(createDate);
}
Date modifiedDate = (Date)attributes.get("modifiedDate");
if (modifiedDate != null) {
setModifiedDate(modifiedDate);
}
Long classNameId = (Long)attributes.get("classNameId");
if (classNameId != null) {
setClassNameId(classNameId);
}
Long classPK = (Long)attributes.get("classPK");
if (classPK != null) {
setClassPK(classPK);
}
Long fileEntryId = (Long)attributes.get("fileEntryId");
if (fileEntryId != null) {
setFileEntryId(fileEntryId);
}
Date displayDate = (Date)attributes.get("displayDate");
if (displayDate != null) {
setDisplayDate(displayDate);
}
Date expirationDate = (Date)attributes.get("expirationDate");
if (expirationDate != null) {
setExpirationDate(expirationDate);
}
String title = (String)attributes.get("title");
if (title != null) {
setTitle(title);
}
String json = (String)attributes.get("json");
if (json != null) {
setJson(json);
}
Double priority = (Double)attributes.get("priority");
if (priority != null) {
setPriority(priority);
}
Integer type = (Integer)attributes.get("type");
if (type != null) {
setType(type);
}
Date lastPublishDate = (Date)attributes.get("lastPublishDate");
if (lastPublishDate != null) {
setLastPublishDate(lastPublishDate);
}
Integer status = (Integer)attributes.get("status");
if (status != null) {
setStatus(status);
}
Long statusByUserId = (Long)attributes.get("statusByUserId");
if (statusByUserId != null) {
setStatusByUserId(statusByUserId);
}
String statusByUserName = (String)attributes.get("statusByUserName");
if (statusByUserName != null) {
setStatusByUserName(statusByUserName);
}
Date statusDate = (Date)attributes.get("statusDate");
if (statusDate != null) {
setStatusDate(statusDate);
}
}
@JSON
@Override
public String getUuid() {
if (_uuid == null) {
return "";
}
else {
return _uuid;
}
}
@Override
public void setUuid(String uuid) {
if (_originalUuid == null) {
_originalUuid = _uuid;
}
_uuid = uuid;
}
public String getOriginalUuid() {
return GetterUtil.getString(_originalUuid);
}
@JSON
@Override
public String getExternalReferenceCode() {
if (_externalReferenceCode == null) {
return "";
}
else {
return _externalReferenceCode;
}
}
@Override
public void setExternalReferenceCode(String externalReferenceCode) {
_columnBitmask |= EXTERNALREFERENCECODE_COLUMN_BITMASK;
if (_originalExternalReferenceCode == null) {
_originalExternalReferenceCode = _externalReferenceCode;
}
_externalReferenceCode = externalReferenceCode;
}
public String getOriginalExternalReferenceCode() {
return GetterUtil.getString(_originalExternalReferenceCode);
}
@JSON
@Override
public long getCPAttachmentFileEntryId() {
return _CPAttachmentFileEntryId;
}
@Override
public void setCPAttachmentFileEntryId(long CPAttachmentFileEntryId) {
_CPAttachmentFileEntryId = CPAttachmentFileEntryId;
}
@JSON
@Override
public long getGroupId() {
return _groupId;
}
@Override
public void setGroupId(long groupId) {
_columnBitmask |= GROUPID_COLUMN_BITMASK;
if (!_setOriginalGroupId) {
_setOriginalGroupId = true;
_originalGroupId = _groupId;
}
_groupId = groupId;
}
public long getOriginalGroupId() {
return _originalGroupId;
}
@JSON
@Override
public long getCompanyId() {
return _companyId;
}
@Override
public void setCompanyId(long companyId) {
_columnBitmask |= COMPANYID_COLUMN_BITMASK;
if (!_setOriginalCompanyId) {
_setOriginalCompanyId = true;
_originalCompanyId = _companyId;
}
_companyId = companyId;
}
public long getOriginalCompanyId() {
return _originalCompanyId;
}
@JSON
@Override
public long getUserId() {
return _userId;
}
@Override
public void setUserId(long userId) {
_userId = userId;
}
@Override
public String getUserUuid() {
try {
User user = UserLocalServiceUtil.getUserById(getUserId());
return user.getUuid();
}
catch (PortalException pe) {
return "";
}
}
@Override
public void setUserUuid(String userUuid) {
}
@JSON
@Override
public String getUserName() {
if (_userName == null) {
return "";
}
else {
return _userName;
}
}
@Override
public void setUserName(String userName) {
_userName = userName;
}
@JSON
@Override
public Date getCreateDate() {
return _createDate;
}
@Override
public void setCreateDate(Date createDate) {
_createDate = createDate;
}
@JSON
@Override
public Date getModifiedDate() {
return _modifiedDate;
}
public boolean hasSetModifiedDate() {
return _setModifiedDate;
}
@Override
public void setModifiedDate(Date modifiedDate) {
_setModifiedDate = true;
_modifiedDate = modifiedDate;
}
@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);
}
@JSON
@Override
public long getClassNameId() {
return _classNameId;
}
@Override
public void setClassNameId(long classNameId) {
_columnBitmask |= CLASSNAMEID_COLUMN_BITMASK;
if (!_setOriginalClassNameId) {
_setOriginalClassNameId = true;
_originalClassNameId = _classNameId;
}
_classNameId = classNameId;
}
public long getOriginalClassNameId() {
return _originalClassNameId;
}
@JSON
@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;
}
@JSON
@Override
public long getFileEntryId() {
return _fileEntryId;
}
@Override
public void setFileEntryId(long fileEntryId) {
_fileEntryId = fileEntryId;
}
@JSON
@Override
public Date getDisplayDate() {
return _displayDate;
}
@Override
public void setDisplayDate(Date displayDate) {
_columnBitmask |= DISPLAYDATE_COLUMN_BITMASK;
if (_originalDisplayDate == null) {
_originalDisplayDate = _displayDate;
}
_displayDate = displayDate;
}
public Date getOriginalDisplayDate() {
return _originalDisplayDate;
}
@JSON
@Override
public Date getExpirationDate() {
return _expirationDate;
}
@Override
public void setExpirationDate(Date expirationDate) {
_expirationDate = expirationDate;
}
@JSON
@Override
public String getTitle() {
if (_title == null) {
return "";
}
else {
return _title;
}
}
@Override
public String getTitle(Locale locale) {
String languageId = LocaleUtil.toLanguageId(locale);
return getTitle(languageId);
}
@Override
public String getTitle(Locale locale, boolean useDefault) {
String languageId = LocaleUtil.toLanguageId(locale);
return getTitle(languageId, useDefault);
}
@Override
public String getTitle(String languageId) {
return LocalizationUtil.getLocalization(getTitle(), languageId);
}
@Override
public String getTitle(String languageId, boolean useDefault) {
return LocalizationUtil.getLocalization(getTitle(), languageId,
useDefault);
}
@Override
public String getTitleCurrentLanguageId() {
return _titleCurrentLanguageId;
}
@JSON
@Override
public String getTitleCurrentValue() {
Locale locale = getLocale(_titleCurrentLanguageId);
return getTitle(locale);
}
@Override
public Map getTitleMap() {
return LocalizationUtil.getLocalizationMap(getTitle());
}
@Override
public void setTitle(String title) {
_title = title;
}
@Override
public void setTitle(String title, Locale locale) {
setTitle(title, locale, LocaleUtil.getSiteDefault());
}
@Override
public void setTitle(String title, Locale locale, Locale defaultLocale) {
String languageId = LocaleUtil.toLanguageId(locale);
String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
if (Validator.isNotNull(title)) {
setTitle(LocalizationUtil.updateLocalization(getTitle(), "Title",
title, languageId, defaultLanguageId));
}
else {
setTitle(LocalizationUtil.removeLocalization(getTitle(), "Title",
languageId));
}
}
@Override
public void setTitleCurrentLanguageId(String languageId) {
_titleCurrentLanguageId = languageId;
}
@Override
public void setTitleMap(Map titleMap) {
setTitleMap(titleMap, LocaleUtil.getSiteDefault());
}
@Override
public void setTitleMap(Map titleMap, Locale defaultLocale) {
if (titleMap == null) {
return;
}
setTitle(LocalizationUtil.updateLocalization(titleMap, getTitle(),
"Title", LocaleUtil.toLanguageId(defaultLocale)));
}
@JSON
@Override
public String getJson() {
if (_json == null) {
return "";
}
else {
return _json;
}
}
@Override
public void setJson(String json) {
_json = json;
}
@JSON
@Override
public double getPriority() {
return _priority;
}
@Override
public void setPriority(double priority) {
_columnBitmask = -1L;
_priority = priority;
}
@JSON
@Override
public int getType() {
return _type;
}
@Override
public void setType(int type) {
_columnBitmask |= TYPE_COLUMN_BITMASK;
if (!_setOriginalType) {
_setOriginalType = true;
_originalType = _type;
}
_type = type;
}
public int getOriginalType() {
return _originalType;
}
@JSON
@Override
public Date getLastPublishDate() {
return _lastPublishDate;
}
@Override
public void setLastPublishDate(Date lastPublishDate) {
_lastPublishDate = lastPublishDate;
}
@JSON
@Override
public int getStatus() {
return _status;
}
@Override
public void setStatus(int status) {
_columnBitmask |= STATUS_COLUMN_BITMASK;
if (!_setOriginalStatus) {
_setOriginalStatus = true;
_originalStatus = _status;
}
_status = status;
}
public int getOriginalStatus() {
return _originalStatus;
}
@JSON
@Override
public long getStatusByUserId() {
return _statusByUserId;
}
@Override
public void setStatusByUserId(long statusByUserId) {
_statusByUserId = statusByUserId;
}
@Override
public String getStatusByUserUuid() {
try {
User user = UserLocalServiceUtil.getUserById(getStatusByUserId());
return user.getUuid();
}
catch (PortalException pe) {
return "";
}
}
@Override
public void setStatusByUserUuid(String statusByUserUuid) {
}
@JSON
@Override
public String getStatusByUserName() {
if (_statusByUserName == null) {
return "";
}
else {
return _statusByUserName;
}
}
@Override
public void setStatusByUserName(String statusByUserName) {
_statusByUserName = statusByUserName;
}
@JSON
@Override
public Date getStatusDate() {
return _statusDate;
}
@Override
public void setStatusDate(Date statusDate) {
_statusDate = statusDate;
}
@Override
public StagedModelType getStagedModelType() {
return new StagedModelType(PortalUtil.getClassNameId(
CPAttachmentFileEntry.class.getName()), getClassNameId());
}
@Override
public boolean isApproved() {
if (getStatus() == WorkflowConstants.STATUS_APPROVED) {
return true;
}
else {
return false;
}
}
@Override
public boolean isDenied() {
if (getStatus() == WorkflowConstants.STATUS_DENIED) {
return true;
}
else {
return false;
}
}
@Override
public boolean isDraft() {
if (getStatus() == WorkflowConstants.STATUS_DRAFT) {
return true;
}
else {
return false;
}
}
@Override
public boolean isExpired() {
if (getStatus() == WorkflowConstants.STATUS_EXPIRED) {
return true;
}
else {
return false;
}
}
@Override
public boolean isInactive() {
if (getStatus() == WorkflowConstants.STATUS_INACTIVE) {
return true;
}
else {
return false;
}
}
@Override
public boolean isIncomplete() {
if (getStatus() == WorkflowConstants.STATUS_INCOMPLETE) {
return true;
}
else {
return false;
}
}
@Override
public boolean isPending() {
if (getStatus() == WorkflowConstants.STATUS_PENDING) {
return true;
}
else {
return false;
}
}
@Override
public boolean isScheduled() {
if (getStatus() == WorkflowConstants.STATUS_SCHEDULED) {
return true;
}
else {
return false;
}
}
public long getColumnBitmask() {
return _columnBitmask;
}
@Override
public ExpandoBridge getExpandoBridge() {
return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
CPAttachmentFileEntry.class.getName(), getPrimaryKey());
}
@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
ExpandoBridge expandoBridge = getExpandoBridge();
expandoBridge.setAttributes(serviceContext);
}
@Override
public String[] getAvailableLanguageIds() {
Set availableLanguageIds = new TreeSet();
Map titleMap = getTitleMap();
for (Map.Entry entry : titleMap.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 = getTitle();
if (xml == null) {
return "";
}
Locale defaultLocale = LocaleUtil.getSiteDefault();
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(CPAttachmentFileEntry.class.getName(),
getPrimaryKey(), defaultLocale, availableLocales);
prepareLocalizedFieldsForImport(defaultImportLocale);
}
@Override
@SuppressWarnings("unused")
public void prepareLocalizedFieldsForImport(Locale defaultImportLocale)
throws LocaleException {
Locale defaultLocale = LocaleUtil.getSiteDefault();
String modelDefaultLanguageId = getDefaultLanguageId();
String title = getTitle(defaultLocale);
if (Validator.isNull(title)) {
setTitle(getTitle(modelDefaultLanguageId), defaultLocale);
}
else {
setTitle(getTitle(defaultLocale), defaultLocale, defaultLocale);
}
}
@Override
public CPAttachmentFileEntry toEscapedModel() {
if (_escapedModel == null) {
_escapedModel = (CPAttachmentFileEntry)ProxyUtil.newProxyInstance(_classLoader,
_escapedModelInterfaces, new AutoEscapeBeanHandler(this));
}
return _escapedModel;
}
@Override
public Object clone() {
CPAttachmentFileEntryImpl cpAttachmentFileEntryImpl = new CPAttachmentFileEntryImpl();
cpAttachmentFileEntryImpl.setUuid(getUuid());
cpAttachmentFileEntryImpl.setExternalReferenceCode(getExternalReferenceCode());
cpAttachmentFileEntryImpl.setCPAttachmentFileEntryId(getCPAttachmentFileEntryId());
cpAttachmentFileEntryImpl.setGroupId(getGroupId());
cpAttachmentFileEntryImpl.setCompanyId(getCompanyId());
cpAttachmentFileEntryImpl.setUserId(getUserId());
cpAttachmentFileEntryImpl.setUserName(getUserName());
cpAttachmentFileEntryImpl.setCreateDate(getCreateDate());
cpAttachmentFileEntryImpl.setModifiedDate(getModifiedDate());
cpAttachmentFileEntryImpl.setClassNameId(getClassNameId());
cpAttachmentFileEntryImpl.setClassPK(getClassPK());
cpAttachmentFileEntryImpl.setFileEntryId(getFileEntryId());
cpAttachmentFileEntryImpl.setDisplayDate(getDisplayDate());
cpAttachmentFileEntryImpl.setExpirationDate(getExpirationDate());
cpAttachmentFileEntryImpl.setTitle(getTitle());
cpAttachmentFileEntryImpl.setJson(getJson());
cpAttachmentFileEntryImpl.setPriority(getPriority());
cpAttachmentFileEntryImpl.setType(getType());
cpAttachmentFileEntryImpl.setLastPublishDate(getLastPublishDate());
cpAttachmentFileEntryImpl.setStatus(getStatus());
cpAttachmentFileEntryImpl.setStatusByUserId(getStatusByUserId());
cpAttachmentFileEntryImpl.setStatusByUserName(getStatusByUserName());
cpAttachmentFileEntryImpl.setStatusDate(getStatusDate());
cpAttachmentFileEntryImpl.resetOriginalValues();
return cpAttachmentFileEntryImpl;
}
@Override
public int compareTo(CPAttachmentFileEntry cpAttachmentFileEntry) {
int value = 0;
if (getPriority() < cpAttachmentFileEntry.getPriority()) {
value = -1;
}
else if (getPriority() > cpAttachmentFileEntry.getPriority()) {
value = 1;
}
else {
value = 0;
}
if (value != 0) {
return value;
}
return 0;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof CPAttachmentFileEntry)) {
return false;
}
CPAttachmentFileEntry cpAttachmentFileEntry = (CPAttachmentFileEntry)obj;
long primaryKey = cpAttachmentFileEntry.getPrimaryKey();
if (getPrimaryKey() == primaryKey) {
return true;
}
else {
return false;
}
}
@Override
public int hashCode() {
return (int)getPrimaryKey();
}
@Override
public boolean isEntityCacheEnabled() {
return ENTITY_CACHE_ENABLED;
}
@Override
public boolean isFinderCacheEnabled() {
return FINDER_CACHE_ENABLED;
}
@Override
public void resetOriginalValues() {
CPAttachmentFileEntryModelImpl cpAttachmentFileEntryModelImpl = this;
cpAttachmentFileEntryModelImpl._originalUuid = cpAttachmentFileEntryModelImpl._uuid;
cpAttachmentFileEntryModelImpl._originalExternalReferenceCode = cpAttachmentFileEntryModelImpl._externalReferenceCode;
cpAttachmentFileEntryModelImpl._originalGroupId = cpAttachmentFileEntryModelImpl._groupId;
cpAttachmentFileEntryModelImpl._setOriginalGroupId = false;
cpAttachmentFileEntryModelImpl._originalCompanyId = cpAttachmentFileEntryModelImpl._companyId;
cpAttachmentFileEntryModelImpl._setOriginalCompanyId = false;
cpAttachmentFileEntryModelImpl._setModifiedDate = false;
cpAttachmentFileEntryModelImpl._originalClassNameId = cpAttachmentFileEntryModelImpl._classNameId;
cpAttachmentFileEntryModelImpl._setOriginalClassNameId = false;
cpAttachmentFileEntryModelImpl._originalClassPK = cpAttachmentFileEntryModelImpl._classPK;
cpAttachmentFileEntryModelImpl._setOriginalClassPK = false;
cpAttachmentFileEntryModelImpl._originalDisplayDate = cpAttachmentFileEntryModelImpl._displayDate;
cpAttachmentFileEntryModelImpl._originalType = cpAttachmentFileEntryModelImpl._type;
cpAttachmentFileEntryModelImpl._setOriginalType = false;
cpAttachmentFileEntryModelImpl._originalStatus = cpAttachmentFileEntryModelImpl._status;
cpAttachmentFileEntryModelImpl._setOriginalStatus = false;
cpAttachmentFileEntryModelImpl._columnBitmask = 0;
}
@Override
public CacheModel toCacheModel() {
CPAttachmentFileEntryCacheModel cpAttachmentFileEntryCacheModel = new CPAttachmentFileEntryCacheModel();
cpAttachmentFileEntryCacheModel.uuid = getUuid();
String uuid = cpAttachmentFileEntryCacheModel.uuid;
if ((uuid != null) && (uuid.length() == 0)) {
cpAttachmentFileEntryCacheModel.uuid = null;
}
cpAttachmentFileEntryCacheModel.externalReferenceCode = getExternalReferenceCode();
String externalReferenceCode = cpAttachmentFileEntryCacheModel.externalReferenceCode;
if ((externalReferenceCode != null) &&
(externalReferenceCode.length() == 0)) {
cpAttachmentFileEntryCacheModel.externalReferenceCode = null;
}
cpAttachmentFileEntryCacheModel.CPAttachmentFileEntryId = getCPAttachmentFileEntryId();
cpAttachmentFileEntryCacheModel.groupId = getGroupId();
cpAttachmentFileEntryCacheModel.companyId = getCompanyId();
cpAttachmentFileEntryCacheModel.userId = getUserId();
cpAttachmentFileEntryCacheModel.userName = getUserName();
String userName = cpAttachmentFileEntryCacheModel.userName;
if ((userName != null) && (userName.length() == 0)) {
cpAttachmentFileEntryCacheModel.userName = null;
}
Date createDate = getCreateDate();
if (createDate != null) {
cpAttachmentFileEntryCacheModel.createDate = createDate.getTime();
}
else {
cpAttachmentFileEntryCacheModel.createDate = Long.MIN_VALUE;
}
Date modifiedDate = getModifiedDate();
if (modifiedDate != null) {
cpAttachmentFileEntryCacheModel.modifiedDate = modifiedDate.getTime();
}
else {
cpAttachmentFileEntryCacheModel.modifiedDate = Long.MIN_VALUE;
}
cpAttachmentFileEntryCacheModel.classNameId = getClassNameId();
cpAttachmentFileEntryCacheModel.classPK = getClassPK();
cpAttachmentFileEntryCacheModel.fileEntryId = getFileEntryId();
Date displayDate = getDisplayDate();
if (displayDate != null) {
cpAttachmentFileEntryCacheModel.displayDate = displayDate.getTime();
}
else {
cpAttachmentFileEntryCacheModel.displayDate = Long.MIN_VALUE;
}
Date expirationDate = getExpirationDate();
if (expirationDate != null) {
cpAttachmentFileEntryCacheModel.expirationDate = expirationDate.getTime();
}
else {
cpAttachmentFileEntryCacheModel.expirationDate = Long.MIN_VALUE;
}
cpAttachmentFileEntryCacheModel.title = getTitle();
String title = cpAttachmentFileEntryCacheModel.title;
if ((title != null) && (title.length() == 0)) {
cpAttachmentFileEntryCacheModel.title = null;
}
cpAttachmentFileEntryCacheModel.json = getJson();
String json = cpAttachmentFileEntryCacheModel.json;
if ((json != null) && (json.length() == 0)) {
cpAttachmentFileEntryCacheModel.json = null;
}
cpAttachmentFileEntryCacheModel.priority = getPriority();
cpAttachmentFileEntryCacheModel.type = getType();
Date lastPublishDate = getLastPublishDate();
if (lastPublishDate != null) {
cpAttachmentFileEntryCacheModel.lastPublishDate = lastPublishDate.getTime();
}
else {
cpAttachmentFileEntryCacheModel.lastPublishDate = Long.MIN_VALUE;
}
cpAttachmentFileEntryCacheModel.status = getStatus();
cpAttachmentFileEntryCacheModel.statusByUserId = getStatusByUserId();
cpAttachmentFileEntryCacheModel.statusByUserName = getStatusByUserName();
String statusByUserName = cpAttachmentFileEntryCacheModel.statusByUserName;
if ((statusByUserName != null) && (statusByUserName.length() == 0)) {
cpAttachmentFileEntryCacheModel.statusByUserName = null;
}
Date statusDate = getStatusDate();
if (statusDate != null) {
cpAttachmentFileEntryCacheModel.statusDate = statusDate.getTime();
}
else {
cpAttachmentFileEntryCacheModel.statusDate = Long.MIN_VALUE;
}
return cpAttachmentFileEntryCacheModel;
}
@Override
public String toString() {
StringBundler sb = new StringBundler(47);
sb.append("{uuid=");
sb.append(getUuid());
sb.append(", externalReferenceCode=");
sb.append(getExternalReferenceCode());
sb.append(", CPAttachmentFileEntryId=");
sb.append(getCPAttachmentFileEntryId());
sb.append(", groupId=");
sb.append(getGroupId());
sb.append(", companyId=");
sb.append(getCompanyId());
sb.append(", userId=");
sb.append(getUserId());
sb.append(", userName=");
sb.append(getUserName());
sb.append(", createDate=");
sb.append(getCreateDate());
sb.append(", modifiedDate=");
sb.append(getModifiedDate());
sb.append(", classNameId=");
sb.append(getClassNameId());
sb.append(", classPK=");
sb.append(getClassPK());
sb.append(", fileEntryId=");
sb.append(getFileEntryId());
sb.append(", displayDate=");
sb.append(getDisplayDate());
sb.append(", expirationDate=");
sb.append(getExpirationDate());
sb.append(", title=");
sb.append(getTitle());
sb.append(", json=");
sb.append(getJson());
sb.append(", priority=");
sb.append(getPriority());
sb.append(", type=");
sb.append(getType());
sb.append(", lastPublishDate=");
sb.append(getLastPublishDate());
sb.append(", status=");
sb.append(getStatus());
sb.append(", statusByUserId=");
sb.append(getStatusByUserId());
sb.append(", statusByUserName=");
sb.append(getStatusByUserName());
sb.append(", statusDate=");
sb.append(getStatusDate());
sb.append("}");
return sb.toString();
}
@Override
public String toXmlString() {
StringBundler sb = new StringBundler(73);
sb.append("");
sb.append("com.liferay.commerce.product.model.CPAttachmentFileEntry");
sb.append(" ");
sb.append(
"uuid ");
sb.append(
"externalReferenceCode ");
sb.append(
"CPAttachmentFileEntryId ");
sb.append(
"groupId ");
sb.append(
"companyId ");
sb.append(
"userId ");
sb.append(
"userName ");
sb.append(
"createDate ");
sb.append(
"modifiedDate ");
sb.append(
"classNameId ");
sb.append(
"classPK ");
sb.append(
"fileEntryId ");
sb.append(
"displayDate ");
sb.append(
"expirationDate ");
sb.append(
"title ");
sb.append(
"json ");
sb.append(
"priority ");
sb.append(
"type ");
sb.append(
"lastPublishDate ");
sb.append(
"status ");
sb.append(
"statusByUserId ");
sb.append(
"statusByUserName ");
sb.append(
"statusDate ");
sb.append(" ");
return sb.toString();
}
private static final ClassLoader _classLoader = CPAttachmentFileEntry.class.getClassLoader();
private static final Class>[] _escapedModelInterfaces = new Class[] {
CPAttachmentFileEntry.class, ModelWrapper.class
};
private String _uuid;
private String _originalUuid;
private String _externalReferenceCode;
private String _originalExternalReferenceCode;
private long _CPAttachmentFileEntryId;
private long _groupId;
private long _originalGroupId;
private boolean _setOriginalGroupId;
private long _companyId;
private long _originalCompanyId;
private boolean _setOriginalCompanyId;
private long _userId;
private String _userName;
private Date _createDate;
private Date _modifiedDate;
private boolean _setModifiedDate;
private long _classNameId;
private long _originalClassNameId;
private boolean _setOriginalClassNameId;
private long _classPK;
private long _originalClassPK;
private boolean _setOriginalClassPK;
private long _fileEntryId;
private Date _displayDate;
private Date _originalDisplayDate;
private Date _expirationDate;
private String _title;
private String _titleCurrentLanguageId;
private String _json;
private double _priority;
private int _type;
private int _originalType;
private boolean _setOriginalType;
private Date _lastPublishDate;
private int _status;
private int _originalStatus;
private boolean _setOriginalStatus;
private long _statusByUserId;
private String _statusByUserName;
private Date _statusDate;
private long _columnBitmask;
private CPAttachmentFileEntry _escapedModel;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy