Package com.arcusys.learn.persistence.liferay.model.impl

Source Code of com.arcusys.learn.persistence.liferay.model.impl.LFCertificateModelImpl

package com.arcusys.learn.persistence.liferay.model.impl;

import com.arcusys.learn.persistence.liferay.model.LFCertificate;
import com.arcusys.learn.persistence.liferay.model.LFCertificateModel;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import java.io.Serializable;

import java.sql.Types;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
* The base model implementation for the LFCertificate service. Represents a row in the "Learn_LFCertificate" database table, with each column mapped to a property of this class.
*
* <p>
* This implementation and its corresponding interface {@link com.arcusys.learn.persistence.liferay.model.LFCertificateModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LFCertificateImpl}.
* </p>
*
* @author Brian Wing Shun Chan
* @see LFCertificateImpl
* @see com.arcusys.learn.persistence.liferay.model.LFCertificate
* @see com.arcusys.learn.persistence.liferay.model.LFCertificateModel
* @generated
*/
public class LFCertificateModelImpl extends BaseModelImpl<LFCertificate>
    implements LFCertificateModel {
    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify or reference this class directly. All methods that expect a l f certificate model instance should use the {@link com.arcusys.learn.persistence.liferay.model.LFCertificate} interface instead.
     */
    public static final String TABLE_NAME = "Learn_LFCertificate";
    public static final Object[][] TABLE_COLUMNS = {
            { "id_", Types.BIGINT },
            { "title", Types.VARCHAR },
            { "description", Types.CLOB },
            { "logo", Types.VARCHAR },
            { "isPermanent", Types.BOOLEAN },
            { "publishBadge", Types.BOOLEAN },
            { "shortDescription", Types.VARCHAR },
            { "companyID", Types.INTEGER },
            { "state_", Types.VARCHAR },
            { "emails", Types.VARCHAR },
            { "validPeriodType", Types.VARCHAR },
            { "validPeriod", Types.INTEGER },
            { "createdDate", Types.TIMESTAMP },
            { "isPublished", Types.BOOLEAN },
            { "scope", Types.BIGINT }
        };
    public static final String TABLE_SQL_CREATE = "create table Learn_LFCertificate (id_ LONG not null primary key,title VARCHAR(3000) null,description TEXT null,logo VARCHAR(75) null,isPermanent BOOLEAN null,publishBadge BOOLEAN null,shortDescription VARCHAR(75) null,companyID INTEGER null,state_ VARCHAR(75) null,emails VARCHAR(75) null,validPeriodType VARCHAR(75) null,validPeriod INTEGER null,createdDate DATE null,isPublished BOOLEAN null,scope LONG null)";
    public static final String TABLE_SQL_DROP = "drop table Learn_LFCertificate";
    public static final String ORDER_BY_JPQL = " ORDER BY lfCertificate.id ASC";
    public static final String ORDER_BY_SQL = " ORDER BY Learn_LFCertificate.id_ 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.util.service.ServiceProps.get(
                "value.object.entity.cache.enabled.com.arcusys.learn.persistence.liferay.model.LFCertificate"),
            false);
    public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
                "value.object.finder.cache.enabled.com.arcusys.learn.persistence.liferay.model.LFCertificate"),
            false);
    public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
                "value.object.column.bitmask.enabled.com.arcusys.learn.persistence.liferay.model.LFCertificate"),
            true);
    public static long COMPANYID_COLUMN_BITMASK = 1L;
    public static long TITLE_COLUMN_BITMASK = 2L;
    public static long ID_COLUMN_BITMASK = 4L;
    public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
                "lock.expiration.time.com.arcusys.learn.persistence.liferay.model.LFCertificate"));
    private static ClassLoader _classLoader = LFCertificate.class.getClassLoader();
    private static Class<?>[] _escapedModelInterfaces = new Class[] {
            LFCertificate.class
        };
    private long _id;
    private String _title;
    private String _originalTitle;
    private String _description;
    private String _logo;
    private Boolean _isPermanent;
    private Boolean _publishBadge;
    private String _shortDescription;
    private Integer _companyID;
    private Integer _originalCompanyID;
    private boolean _setOriginalCompanyID;
    private String _state;
    private String _emails;
    private String _validPeriodType;
    private Integer _validPeriod;
    private Date _createdDate;
    private Boolean _isPublished;
    private Long _scope;
    private long _columnBitmask;
    private LFCertificate _escapedModel;

    public LFCertificateModelImpl() {
    }

    @Override
    public long getPrimaryKey() {
        return _id;
    }

    @Override
    public void setPrimaryKey(long primaryKey) {
        setId(primaryKey);
    }

    @Override
    public Serializable getPrimaryKeyObj() {
        return _id;
    }

    @Override
    public void setPrimaryKeyObj(Serializable primaryKeyObj) {
        setPrimaryKey(((Long) primaryKeyObj).longValue());
    }

    @Override
    public Class<?> getModelClass() {
        return LFCertificate.class;
    }

    @Override
    public String getModelClassName() {
        return LFCertificate.class.getName();
    }

    @Override
    public Map<String, Object> getModelAttributes() {
        Map<String, Object> attributes = new HashMap<String, Object>();

        attributes.put("id", getId());
        attributes.put("title", getTitle());
        attributes.put("description", getDescription());
        attributes.put("logo", getLogo());
        attributes.put("isPermanent", getIsPermanent());
        attributes.put("publishBadge", getPublishBadge());
        attributes.put("shortDescription", getShortDescription());
        attributes.put("companyID", getCompanyID());
        attributes.put("state", getState());
        attributes.put("emails", getEmails());
        attributes.put("validPeriodType", getValidPeriodType());
        attributes.put("validPeriod", getValidPeriod());
        attributes.put("createdDate", getCreatedDate());
        attributes.put("isPublished", getIsPublished());
        attributes.put("scope", getScope());

        return attributes;
    }

    @Override
    public void setModelAttributes(Map<String, Object> attributes) {
        Long id = (Long) attributes.get("id");

        if (id != null) {
            setId(id);
        }

        String title = (String) attributes.get("title");

        if (title != null) {
            setTitle(title);
        }

        String description = (String) attributes.get("description");

        if (description != null) {
            setDescription(description);
        }

        String logo = (String) attributes.get("logo");

        if (logo != null) {
            setLogo(logo);
        }

        Boolean isPermanent = (Boolean) attributes.get("isPermanent");

        if (isPermanent != null) {
            setIsPermanent(isPermanent);
        }

        Boolean publishBadge = (Boolean) attributes.get("publishBadge");

        if (publishBadge != null) {
            setPublishBadge(publishBadge);
        }

        String shortDescription = (String) attributes.get("shortDescription");

        if (shortDescription != null) {
            setShortDescription(shortDescription);
        }

        Integer companyID = (Integer) attributes.get("companyID");

        if (companyID != null) {
            setCompanyID(companyID);
        }

        String state = (String) attributes.get("state");

        if (state != null) {
            setState(state);
        }

        String emails = (String) attributes.get("emails");

        if (emails != null) {
            setEmails(emails);
        }

        String validPeriodType = (String) attributes.get("validPeriodType");

        if (validPeriodType != null) {
            setValidPeriodType(validPeriodType);
        }

        Integer validPeriod = (Integer) attributes.get("validPeriod");

        if (validPeriod != null) {
            setValidPeriod(validPeriod);
        }

        Date createdDate = (Date) attributes.get("createdDate");

        if (createdDate != null) {
            setCreatedDate(createdDate);
        }

        Boolean isPublished = (Boolean) attributes.get("isPublished");

        if (isPublished != null) {
            setIsPublished(isPublished);
        }

        Long scope = (Long) attributes.get("scope");

        if (scope != null) {
            setScope(scope);
        }
    }

    @Override
    public long getId() {
        return _id;
    }

    @Override
    public void setId(long id) {
        _id = id;
    }

    @Override
    public String getTitle() {
        if (_title == null) {
            return StringPool.BLANK;
        } else {
            return _title;
        }
    }

    @Override
    public void setTitle(String title) {
        _columnBitmask |= TITLE_COLUMN_BITMASK;

        if (_originalTitle == null) {
            _originalTitle = _title;
        }

        _title = title;
    }

    public String getOriginalTitle() {
        return GetterUtil.getString(_originalTitle);
    }

    @Override
    public String getDescription() {
        if (_description == null) {
            return StringPool.BLANK;
        } else {
            return _description;
        }
    }

    @Override
    public void setDescription(String description) {
        _description = description;
    }

    @Override
    public String getLogo() {
        if (_logo == null) {
            return StringPool.BLANK;
        } else {
            return _logo;
        }
    }

    @Override
    public void setLogo(String logo) {
        _logo = logo;
    }

    @Override
    public Boolean getIsPermanent() {
        return _isPermanent;
    }

    @Override
    public void setIsPermanent(Boolean isPermanent) {
        _isPermanent = isPermanent;
    }

    @Override
    public Boolean getPublishBadge() {
        return _publishBadge;
    }

    @Override
    public void setPublishBadge(Boolean publishBadge) {
        _publishBadge = publishBadge;
    }

    @Override
    public String getShortDescription() {
        if (_shortDescription == null) {
            return StringPool.BLANK;
        } else {
            return _shortDescription;
        }
    }

    @Override
    public void setShortDescription(String shortDescription) {
        _shortDescription = shortDescription;
    }

    @Override
    public Integer getCompanyID() {
        return _companyID;
    }

    @Override
    public void setCompanyID(Integer companyID) {
        _columnBitmask |= COMPANYID_COLUMN_BITMASK;

        if (!_setOriginalCompanyID) {
            _setOriginalCompanyID = true;

            _originalCompanyID = _companyID;
        }

        _companyID = companyID;
    }

    public Integer getOriginalCompanyID() {
        return _originalCompanyID;
    }

    @Override
    public String getState() {
        return _state;
    }

    @Override
    public void setState(String state) {
        _state = state;
    }

    @Override
    public String getEmails() {
        if (_emails == null) {
            return StringPool.BLANK;
        } else {
            return _emails;
        }
    }

    @Override
    public void setEmails(String emails) {
        _emails = emails;
    }

    @Override
    public String getValidPeriodType() {
        return _validPeriodType;
    }

    @Override
    public void setValidPeriodType(String validPeriodType) {
        _validPeriodType = validPeriodType;
    }

    @Override
    public Integer getValidPeriod() {
        return _validPeriod;
    }

    @Override
    public void setValidPeriod(Integer validPeriod) {
        _validPeriod = validPeriod;
    }

    @Override
    public Date getCreatedDate() {
        return _createdDate;
    }

    @Override
    public void setCreatedDate(Date createdDate) {
        _createdDate = createdDate;
    }

    @Override
    public Boolean getIsPublished() {
        return _isPublished;
    }

    @Override
    public void setIsPublished(Boolean isPublished) {
        _isPublished = isPublished;
    }

    @Override
    public Long getScope() {
        return _scope;
    }

    @Override
    public void setScope(Long scope) {
        _scope = scope;
    }

    public long getColumnBitmask() {
        return _columnBitmask;
    }

    @Override
    public ExpandoBridge getExpandoBridge() {
        return ExpandoBridgeFactoryUtil.getExpandoBridge(0,
            LFCertificate.class.getName(), getPrimaryKey());
    }

    @Override
    public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
        ExpandoBridge expandoBridge = getExpandoBridge();

        expandoBridge.setAttributes(serviceContext);
    }

    @Override
    public LFCertificate toEscapedModel() {
        if (_escapedModel == null) {
            _escapedModel = (LFCertificate) ProxyUtil.newProxyInstance(_classLoader,
                    _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
        }

        return _escapedModel;
    }

    @Override
    public Object clone() {
        LFCertificateImpl lfCertificateImpl = new LFCertificateImpl();

        lfCertificateImpl.setId(getId());
        lfCertificateImpl.setTitle(getTitle());
        lfCertificateImpl.setDescription(getDescription());
        lfCertificateImpl.setLogo(getLogo());
        lfCertificateImpl.setIsPermanent(getIsPermanent());
        lfCertificateImpl.setPublishBadge(getPublishBadge());
        lfCertificateImpl.setShortDescription(getShortDescription());
        lfCertificateImpl.setCompanyID(getCompanyID());
        lfCertificateImpl.setState(getState());
        lfCertificateImpl.setEmails(getEmails());
        lfCertificateImpl.setValidPeriodType(getValidPeriodType());
        lfCertificateImpl.setValidPeriod(getValidPeriod());
        lfCertificateImpl.setCreatedDate(getCreatedDate());
        lfCertificateImpl.setIsPublished(getIsPublished());
        lfCertificateImpl.setScope(getScope());

        lfCertificateImpl.resetOriginalValues();

        return lfCertificateImpl;
    }

    @Override
    public int compareTo(LFCertificate lfCertificate) {
        long primaryKey = lfCertificate.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 LFCertificate)) {
            return false;
        }

        LFCertificate lfCertificate = (LFCertificate) obj;

        long primaryKey = lfCertificate.getPrimaryKey();

        if (getPrimaryKey() == primaryKey) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        return (int) getPrimaryKey();
    }

    @Override
    public void resetOriginalValues() {
        LFCertificateModelImpl lfCertificateModelImpl = this;

        lfCertificateModelImpl._originalTitle = lfCertificateModelImpl._title;

        lfCertificateModelImpl._originalCompanyID = lfCertificateModelImpl._companyID;

        lfCertificateModelImpl._setOriginalCompanyID = false;

        lfCertificateModelImpl._columnBitmask = 0;
    }

    @Override
    public CacheModel<LFCertificate> toCacheModel() {
        LFCertificateCacheModel lfCertificateCacheModel = new LFCertificateCacheModel();

        lfCertificateCacheModel.id = getId();

        lfCertificateCacheModel.title = getTitle();

        String title = lfCertificateCacheModel.title;

        if ((title != null) && (title.length() == 0)) {
            lfCertificateCacheModel.title = null;
        }

        lfCertificateCacheModel.description = getDescription();

        String description = lfCertificateCacheModel.description;

        if ((description != null) && (description.length() == 0)) {
            lfCertificateCacheModel.description = null;
        }

        lfCertificateCacheModel.logo = getLogo();

        String logo = lfCertificateCacheModel.logo;

        if ((logo != null) && (logo.length() == 0)) {
            lfCertificateCacheModel.logo = null;
        }

        lfCertificateCacheModel.isPermanent = getIsPermanent();

        lfCertificateCacheModel.publishBadge = getPublishBadge();

        lfCertificateCacheModel.shortDescription = getShortDescription();

        String shortDescription = lfCertificateCacheModel.shortDescription;

        if ((shortDescription != null) && (shortDescription.length() == 0)) {
            lfCertificateCacheModel.shortDescription = null;
        }

        lfCertificateCacheModel.companyID = getCompanyID();

        lfCertificateCacheModel.state = getState();

        String state = lfCertificateCacheModel.state;

        if ((state != null) && (state.length() == 0)) {
            lfCertificateCacheModel.state = null;
        }

        lfCertificateCacheModel.emails = getEmails();

        String emails = lfCertificateCacheModel.emails;

        if ((emails != null) && (emails.length() == 0)) {
            lfCertificateCacheModel.emails = null;
        }

        lfCertificateCacheModel.validPeriodType = getValidPeriodType();

        String validPeriodType = lfCertificateCacheModel.validPeriodType;

        if ((validPeriodType != null) && (validPeriodType.length() == 0)) {
            lfCertificateCacheModel.validPeriodType = null;
        }

        lfCertificateCacheModel.validPeriod = getValidPeriod();

        Date createdDate = getCreatedDate();

        if (createdDate != null) {
            lfCertificateCacheModel.createdDate = createdDate.getTime();
        } else {
            lfCertificateCacheModel.createdDate = Long.MIN_VALUE;
        }

        lfCertificateCacheModel.isPublished = getIsPublished();

        lfCertificateCacheModel.scope = getScope();

        return lfCertificateCacheModel;
    }

    @Override
    public String toString() {
        StringBundler sb = new StringBundler(31);

        sb.append("{id=");
        sb.append(getId());
        sb.append(", title=");
        sb.append(getTitle());
        sb.append(", description=");
        sb.append(getDescription());
        sb.append(", logo=");
        sb.append(getLogo());
        sb.append(", isPermanent=");
        sb.append(getIsPermanent());
        sb.append(", publishBadge=");
        sb.append(getPublishBadge());
        sb.append(", shortDescription=");
        sb.append(getShortDescription());
        sb.append(", companyID=");
        sb.append(getCompanyID());
        sb.append(", state=");
        sb.append(getState());
        sb.append(", emails=");
        sb.append(getEmails());
        sb.append(", validPeriodType=");
        sb.append(getValidPeriodType());
        sb.append(", validPeriod=");
        sb.append(getValidPeriod());
        sb.append(", createdDate=");
        sb.append(getCreatedDate());
        sb.append(", isPublished=");
        sb.append(getIsPublished());
        sb.append(", scope=");
        sb.append(getScope());
        sb.append("}");

        return sb.toString();
    }

    @Override
    public String toXmlString() {
        StringBundler sb = new StringBundler(49);

        sb.append("<model><model-name>");
        sb.append("com.arcusys.learn.persistence.liferay.model.LFCertificate");
        sb.append("</model-name>");

        sb.append(
            "<column><column-name>id</column-name><column-value><![CDATA[");
        sb.append(getId());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>title</column-name><column-value><![CDATA[");
        sb.append(getTitle());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>description</column-name><column-value><![CDATA[");
        sb.append(getDescription());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>logo</column-name><column-value><![CDATA[");
        sb.append(getLogo());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>isPermanent</column-name><column-value><![CDATA[");
        sb.append(getIsPermanent());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>publishBadge</column-name><column-value><![CDATA[");
        sb.append(getPublishBadge());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>shortDescription</column-name><column-value><![CDATA[");
        sb.append(getShortDescription());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>companyID</column-name><column-value><![CDATA[");
        sb.append(getCompanyID());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>state</column-name><column-value><![CDATA[");
        sb.append(getState());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>emails</column-name><column-value><![CDATA[");
        sb.append(getEmails());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>validPeriodType</column-name><column-value><![CDATA[");
        sb.append(getValidPeriodType());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>validPeriod</column-name><column-value><![CDATA[");
        sb.append(getValidPeriod());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>createdDate</column-name><column-value><![CDATA[");
        sb.append(getCreatedDate());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>isPublished</column-name><column-value><![CDATA[");
        sb.append(getIsPublished());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>scope</column-name><column-value><![CDATA[");
        sb.append(getScope());
        sb.append("]]></column-value></column>");

        sb.append("</model>");

        return sb.toString();
    }
}
TOP

Related Classes of com.arcusys.learn.persistence.liferay.model.impl.LFCertificateModelImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.