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

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

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

import com.arcusys.learn.persistence.liferay.model.LFRollupRule;
import com.arcusys.learn.persistence.liferay.model.LFRollupRuleModel;

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.math.BigDecimal;

import java.sql.Types;

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

/**
* The base model implementation for the LFRollupRule service. Represents a row in the "Learn_LFRollupRule" 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.LFRollupRuleModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LFRollupRuleImpl}.
* </p>
*
* @author Brian Wing Shun Chan
* @see LFRollupRuleImpl
* @see com.arcusys.learn.persistence.liferay.model.LFRollupRule
* @see com.arcusys.learn.persistence.liferay.model.LFRollupRuleModel
* @generated
*/
public class LFRollupRuleModelImpl extends BaseModelImpl<LFRollupRule>
    implements LFRollupRuleModel {
    /*
     * NOTE FOR DEVELOPERS:
     *
     * Never modify or reference this class directly. All methods that expect a l f rollup rule model instance should use the {@link com.arcusys.learn.persistence.liferay.model.LFRollupRule} interface instead.
     */
    public static final String TABLE_NAME = "Learn_LFRollupRule";
    public static final Object[][] TABLE_COLUMNS = {
            { "id_", Types.BIGINT },
            { "sequencingID", Types.INTEGER },
            { "combination", Types.CLOB },
            { "childActivitySet", Types.CLOB },
            { "minimumCount", Types.INTEGER },
            { "minimumPercent", Types.NUMERIC },
            { "action", Types.CLOB }
        };
    public static final String TABLE_SQL_CREATE = "create table Learn_LFRollupRule (id_ LONG not null primary key,sequencingID INTEGER null,combination TEXT null,childActivitySet TEXT null,minimumCount INTEGER null,minimumPercent NUMERIC(20,2),action TEXT null)";
    public static final String TABLE_SQL_DROP = "drop table Learn_LFRollupRule";
    public static final String ORDER_BY_JPQL = " ORDER BY lfRollupRule.id ASC";
    public static final String ORDER_BY_SQL = " ORDER BY Learn_LFRollupRule.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.LFRollupRule"),
            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.LFRollupRule"),
            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.LFRollupRule"),
            true);
    public static long SEQUENCINGID_COLUMN_BITMASK = 1L;
    public static long ID_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.LFRollupRule"));
    private static ClassLoader _classLoader = LFRollupRule.class.getClassLoader();
    private static Class<?>[] _escapedModelInterfaces = new Class[] {
            LFRollupRule.class
        };
    private long _id;
    private Integer _sequencingID;
    private Integer _originalSequencingID;
    private boolean _setOriginalSequencingID;
    private String _combination;
    private String _childActivitySet;
    private Integer _minimumCount;
    private BigDecimal _minimumPercent;
    private String _action;
    private long _columnBitmask;
    private LFRollupRule _escapedModel;

    public LFRollupRuleModelImpl() {
    }

    @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 LFRollupRule.class;
    }

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

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

        attributes.put("id", getId());
        attributes.put("sequencingID", getSequencingID());
        attributes.put("combination", getCombination());
        attributes.put("childActivitySet", getChildActivitySet());
        attributes.put("minimumCount", getMinimumCount());
        attributes.put("minimumPercent", getMinimumPercent());
        attributes.put("action", getAction());

        return attributes;
    }

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

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

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

        if (sequencingID != null) {
            setSequencingID(sequencingID);
        }

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

        if (combination != null) {
            setCombination(combination);
        }

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

        if (childActivitySet != null) {
            setChildActivitySet(childActivitySet);
        }

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

        if (minimumCount != null) {
            setMinimumCount(minimumCount);
        }

        BigDecimal minimumPercent = (BigDecimal) attributes.get(
                "minimumPercent");

        if (minimumPercent != null) {
            setMinimumPercent(minimumPercent);
        }

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

        if (action != null) {
            setAction(action);
        }
    }

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

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

    @Override
    public Integer getSequencingID() {
        return _sequencingID;
    }

    @Override
    public void setSequencingID(Integer sequencingID) {
        _columnBitmask |= SEQUENCINGID_COLUMN_BITMASK;

        if (!_setOriginalSequencingID) {
            _setOriginalSequencingID = true;

            _originalSequencingID = _sequencingID;
        }

        _sequencingID = sequencingID;
    }

    public Integer getOriginalSequencingID() {
        return _originalSequencingID;
    }

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

    @Override
    public void setCombination(String combination) {
        _combination = combination;
    }

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

    @Override
    public void setChildActivitySet(String childActivitySet) {
        _childActivitySet = childActivitySet;
    }

    @Override
    public Integer getMinimumCount() {
        return _minimumCount;
    }

    @Override
    public void setMinimumCount(Integer minimumCount) {
        _minimumCount = minimumCount;
    }

    @Override
    public BigDecimal getMinimumPercent() {
        return _minimumPercent;
    }

    @Override
    public void setMinimumPercent(BigDecimal minimumPercent) {
        _minimumPercent = minimumPercent;
    }

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

    @Override
    public void setAction(String action) {
        _action = action;
    }

    public long getColumnBitmask() {
        return _columnBitmask;
    }

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

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

        expandoBridge.setAttributes(serviceContext);
    }

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

        return _escapedModel;
    }

    @Override
    public Object clone() {
        LFRollupRuleImpl lfRollupRuleImpl = new LFRollupRuleImpl();

        lfRollupRuleImpl.setId(getId());
        lfRollupRuleImpl.setSequencingID(getSequencingID());
        lfRollupRuleImpl.setCombination(getCombination());
        lfRollupRuleImpl.setChildActivitySet(getChildActivitySet());
        lfRollupRuleImpl.setMinimumCount(getMinimumCount());
        lfRollupRuleImpl.setMinimumPercent(getMinimumPercent());
        lfRollupRuleImpl.setAction(getAction());

        lfRollupRuleImpl.resetOriginalValues();

        return lfRollupRuleImpl;
    }

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

        LFRollupRule lfRollupRule = (LFRollupRule) obj;

        long primaryKey = lfRollupRule.getPrimaryKey();

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

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

    @Override
    public void resetOriginalValues() {
        LFRollupRuleModelImpl lfRollupRuleModelImpl = this;

        lfRollupRuleModelImpl._originalSequencingID = lfRollupRuleModelImpl._sequencingID;

        lfRollupRuleModelImpl._setOriginalSequencingID = false;

        lfRollupRuleModelImpl._columnBitmask = 0;
    }

    @Override
    public CacheModel<LFRollupRule> toCacheModel() {
        LFRollupRuleCacheModel lfRollupRuleCacheModel = new LFRollupRuleCacheModel();

        lfRollupRuleCacheModel.id = getId();

        lfRollupRuleCacheModel.sequencingID = getSequencingID();

        lfRollupRuleCacheModel.combination = getCombination();

        String combination = lfRollupRuleCacheModel.combination;

        if ((combination != null) && (combination.length() == 0)) {
            lfRollupRuleCacheModel.combination = null;
        }

        lfRollupRuleCacheModel.childActivitySet = getChildActivitySet();

        String childActivitySet = lfRollupRuleCacheModel.childActivitySet;

        if ((childActivitySet != null) && (childActivitySet.length() == 0)) {
            lfRollupRuleCacheModel.childActivitySet = null;
        }

        lfRollupRuleCacheModel.minimumCount = getMinimumCount();

        lfRollupRuleCacheModel.minimumPercent = getMinimumPercent();

        lfRollupRuleCacheModel.action = getAction();

        String action = lfRollupRuleCacheModel.action;

        if ((action != null) && (action.length() == 0)) {
            lfRollupRuleCacheModel.action = null;
        }

        return lfRollupRuleCacheModel;
    }

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

        sb.append("{id=");
        sb.append(getId());
        sb.append(", sequencingID=");
        sb.append(getSequencingID());
        sb.append(", combination=");
        sb.append(getCombination());
        sb.append(", childActivitySet=");
        sb.append(getChildActivitySet());
        sb.append(", minimumCount=");
        sb.append(getMinimumCount());
        sb.append(", minimumPercent=");
        sb.append(getMinimumPercent());
        sb.append(", action=");
        sb.append(getAction());
        sb.append("}");

        return sb.toString();
    }

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

        sb.append("<model><model-name>");
        sb.append("com.arcusys.learn.persistence.liferay.model.LFRollupRule");
        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>sequencingID</column-name><column-value><![CDATA[");
        sb.append(getSequencingID());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>combination</column-name><column-value><![CDATA[");
        sb.append(getCombination());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>childActivitySet</column-name><column-value><![CDATA[");
        sb.append(getChildActivitySet());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>minimumCount</column-name><column-value><![CDATA[");
        sb.append(getMinimumCount());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>minimumPercent</column-name><column-value><![CDATA[");
        sb.append(getMinimumPercent());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>action</column-name><column-value><![CDATA[");
        sb.append(getAction());
        sb.append("]]></column-value></column>");

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

        return sb.toString();
    }
}
TOP

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

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.