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

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

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

import com.arcusys.learn.persistence.liferay.model.LFCertificateCourse;
import com.arcusys.learn.persistence.liferay.model.LFCertificateCourseModel;
import com.arcusys.learn.persistence.liferay.service.persistence.LFCertificateCoursePK;

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.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.sql.Types;

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

/**
* The base model implementation for the LFCertificateCourse service. Represents a row in the "Learn_LFCertificateCourse" 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.LFCertificateCourseModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LFCertificateCourseImpl}.
* </p>
*
* @author Brian Wing Shun Chan
* @see LFCertificateCourseImpl
* @see com.arcusys.learn.persistence.liferay.model.LFCertificateCourse
* @see com.arcusys.learn.persistence.liferay.model.LFCertificateCourseModel
* @generated
*/
public class LFCertificateCourseModelImpl extends BaseModelImpl<LFCertificateCourse>
    implements LFCertificateCourseModel {
    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify or reference this class directly. All methods that expect a l f certificate course model instance should use the {@link com.arcusys.learn.persistence.liferay.model.LFCertificateCourse} interface instead.
     */
    public static final String TABLE_NAME = "Learn_LFCertificateCourse";
    public static final Object[][] TABLE_COLUMNS = {
            { "certificateID", Types.BIGINT },
            { "courseID", Types.BIGINT },
            { "arrangementIndex", Types.INTEGER },
            { "periodType", Types.VARCHAR },
            { "period", Types.INTEGER }
        };
    public static final String TABLE_SQL_CREATE = "create table Learn_LFCertificateCourse (certificateID LONG not null,courseID LONG not null,arrangementIndex INTEGER null,periodType VARCHAR(75) null,period INTEGER null,primary key (certificateID, courseID))";
    public static final String TABLE_SQL_DROP = "drop table Learn_LFCertificateCourse";
    public static final String ORDER_BY_JPQL = " ORDER BY lfCertificateCourse.id.certificateID ASC, lfCertificateCourse.id.courseID ASC";
    public static final String ORDER_BY_SQL = " ORDER BY Learn_LFCertificateCourse.certificateID ASC, Learn_LFCertificateCourse.courseID 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.LFCertificateCourse"),
            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.LFCertificateCourse"),
            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.LFCertificateCourse"),
            true);
    public static long CERTIFICATEID_COLUMN_BITMASK = 1L;
    public static long COURSEID_COLUMN_BITMASK = 2L;
    public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
                "lock.expiration.time.com.arcusys.learn.persistence.liferay.model.LFCertificateCourse"));
    private static ClassLoader _classLoader = LFCertificateCourse.class.getClassLoader();
    private static Class<?>[] _escapedModelInterfaces = new Class[] {
            LFCertificateCourse.class
        };
    private Long _certificateID;
    private Long _originalCertificateID;
    private boolean _setOriginalCertificateID;
    private Long _courseID;
    private Long _originalCourseID;
    private boolean _setOriginalCourseID;
    private Integer _arrangementIndex;
    private String _periodType;
    private Integer _period;
    private long _columnBitmask;
    private LFCertificateCourse _escapedModel;

    public LFCertificateCourseModelImpl() {
    }

    @Override
    public LFCertificateCoursePK getPrimaryKey() {
        return new LFCertificateCoursePK(_certificateID, _courseID);
    }

    @Override
    public void setPrimaryKey(LFCertificateCoursePK primaryKey) {
        setCertificateID(primaryKey.certificateID);
        setCourseID(primaryKey.courseID);
    }

    @Override
    public Serializable getPrimaryKeyObj() {
        return new LFCertificateCoursePK(_certificateID, _courseID);
    }

    @Override
    public void setPrimaryKeyObj(Serializable primaryKeyObj) {
        setPrimaryKey((LFCertificateCoursePK) primaryKeyObj);
    }

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

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

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

        attributes.put("certificateID", getCertificateID());
        attributes.put("courseID", getCourseID());
        attributes.put("arrangementIndex", getArrangementIndex());
        attributes.put("periodType", getPeriodType());
        attributes.put("period", getPeriod());

        return attributes;
    }

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

        if (certificateID != null) {
            setCertificateID(certificateID);
        }

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

        if (courseID != null) {
            setCourseID(courseID);
        }

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

        if (arrangementIndex != null) {
            setArrangementIndex(arrangementIndex);
        }

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

        if (periodType != null) {
            setPeriodType(periodType);
        }

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

        if (period != null) {
            setPeriod(period);
        }
    }

    @Override
    public Long getCertificateID() {
        return _certificateID;
    }

    @Override
    public void setCertificateID(Long certificateID) {
        _columnBitmask |= CERTIFICATEID_COLUMN_BITMASK;

        if (!_setOriginalCertificateID) {
            _setOriginalCertificateID = true;

            _originalCertificateID = _certificateID;
        }

        _certificateID = certificateID;
    }

    public Long getOriginalCertificateID() {
        return _originalCertificateID;
    }

    @Override
    public Long getCourseID() {
        return _courseID;
    }

    @Override
    public void setCourseID(Long courseID) {
        _columnBitmask |= COURSEID_COLUMN_BITMASK;

        if (!_setOriginalCourseID) {
            _setOriginalCourseID = true;

            _originalCourseID = _courseID;
        }

        _courseID = courseID;
    }

    public Long getOriginalCourseID() {
        return _originalCourseID;
    }

    @Override
    public Integer getArrangementIndex() {
        return _arrangementIndex;
    }

    @Override
    public void setArrangementIndex(Integer arrangementIndex) {
        _arrangementIndex = arrangementIndex;
    }

    @Override
    public String getPeriodType() {
        return _periodType;
    }

    @Override
    public void setPeriodType(String periodType) {
        _periodType = periodType;
    }

    @Override
    public Integer getPeriod() {
        return _period;
    }

    @Override
    public void setPeriod(Integer period) {
        _period = period;
    }

    public long getColumnBitmask() {
        return _columnBitmask;
    }

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

        return _escapedModel;
    }

    @Override
    public Object clone() {
        LFCertificateCourseImpl lfCertificateCourseImpl = new LFCertificateCourseImpl();

        lfCertificateCourseImpl.setCertificateID(getCertificateID());
        lfCertificateCourseImpl.setCourseID(getCourseID());
        lfCertificateCourseImpl.setArrangementIndex(getArrangementIndex());
        lfCertificateCourseImpl.setPeriodType(getPeriodType());
        lfCertificateCourseImpl.setPeriod(getPeriod());

        lfCertificateCourseImpl.resetOriginalValues();

        return lfCertificateCourseImpl;
    }

    @Override
    public int compareTo(LFCertificateCourse lfCertificateCourse) {
        LFCertificateCoursePK primaryKey = lfCertificateCourse.getPrimaryKey();

        return getPrimaryKey().compareTo(primaryKey);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof LFCertificateCourse)) {
            return false;
        }

        LFCertificateCourse lfCertificateCourse = (LFCertificateCourse) obj;

        LFCertificateCoursePK primaryKey = lfCertificateCourse.getPrimaryKey();

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

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

    @Override
    public void resetOriginalValues() {
        LFCertificateCourseModelImpl lfCertificateCourseModelImpl = this;

        lfCertificateCourseModelImpl._originalCertificateID = lfCertificateCourseModelImpl._certificateID;

        lfCertificateCourseModelImpl._setOriginalCertificateID = false;

        lfCertificateCourseModelImpl._originalCourseID = lfCertificateCourseModelImpl._courseID;

        lfCertificateCourseModelImpl._setOriginalCourseID = false;

        lfCertificateCourseModelImpl._columnBitmask = 0;
    }

    @Override
    public CacheModel<LFCertificateCourse> toCacheModel() {
        LFCertificateCourseCacheModel lfCertificateCourseCacheModel = new LFCertificateCourseCacheModel();

        lfCertificateCourseCacheModel.certificateID = getCertificateID();

        lfCertificateCourseCacheModel.courseID = getCourseID();

        lfCertificateCourseCacheModel.arrangementIndex = getArrangementIndex();

        lfCertificateCourseCacheModel.periodType = getPeriodType();

        String periodType = lfCertificateCourseCacheModel.periodType;

        if ((periodType != null) && (periodType.length() == 0)) {
            lfCertificateCourseCacheModel.periodType = null;
        }

        lfCertificateCourseCacheModel.period = getPeriod();

        return lfCertificateCourseCacheModel;
    }

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

        sb.append("{certificateID=");
        sb.append(getCertificateID());
        sb.append(", courseID=");
        sb.append(getCourseID());
        sb.append(", arrangementIndex=");
        sb.append(getArrangementIndex());
        sb.append(", periodType=");
        sb.append(getPeriodType());
        sb.append(", period=");
        sb.append(getPeriod());
        sb.append("}");

        return sb.toString();
    }

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

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

        sb.append(
            "<column><column-name>certificateID</column-name><column-value><![CDATA[");
        sb.append(getCertificateID());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>courseID</column-name><column-value><![CDATA[");
        sb.append(getCourseID());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>arrangementIndex</column-name><column-value><![CDATA[");
        sb.append(getArrangementIndex());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>periodType</column-name><column-value><![CDATA[");
        sb.append(getPeriodType());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>period</column-name><column-value><![CDATA[");
        sb.append(getPeriod());
        sb.append("]]></column-value></column>");

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

        return sb.toString();
    }
}
TOP

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

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.