package com.arcusys.learn.persistence.liferay.model.impl;
import com.arcusys.learn.persistence.liferay.model.LFBigDecimal;
import com.arcusys.learn.persistence.liferay.model.LFBigDecimalModel;
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 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 LFBigDecimal service. Represents a row in the "Learn_LFBigDecimal" 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.LFBigDecimalModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LFBigDecimalImpl}.
* </p>
*
* @author Brian Wing Shun Chan
* @see LFBigDecimalImpl
* @see com.arcusys.learn.persistence.liferay.model.LFBigDecimal
* @see com.arcusys.learn.persistence.liferay.model.LFBigDecimalModel
* @generated
*/
public class LFBigDecimalModelImpl extends BaseModelImpl<LFBigDecimal>
implements LFBigDecimalModel {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. All methods that expect a l f big decimal model instance should use the {@link com.arcusys.learn.persistence.liferay.model.LFBigDecimal} interface instead.
*/
public static final String TABLE_NAME = "Learn_LFBigDecimal";
public static final Object[][] TABLE_COLUMNS = {
{ "id_", Types.BIGINT },
{ "decimal_", Types.NUMERIC },
{ "text_", Types.VARCHAR }
};
public static final String TABLE_SQL_CREATE = "create table Learn_LFBigDecimal (id_ LONG not null primary key,decimal_ NUMERIC(20,2),text_ VARCHAR(75) null)";
public static final String TABLE_SQL_DROP = "drop table Learn_LFBigDecimal";
public static final String ORDER_BY_JPQL = " ORDER BY lfBigDecimal.id ASC";
public static final String ORDER_BY_SQL = " ORDER BY Learn_LFBigDecimal.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.LFBigDecimal"),
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.LFBigDecimal"),
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.LFBigDecimal"),
true);
public static long DECIMAL_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.LFBigDecimal"));
private static ClassLoader _classLoader = LFBigDecimal.class.getClassLoader();
private static Class<?>[] _escapedModelInterfaces = new Class[] {
LFBigDecimal.class
};
private long _id;
private BigDecimal _decimal;
private BigDecimal _originalDecimal;
private String _text;
private long _columnBitmask;
private LFBigDecimal _escapedModel;
public LFBigDecimalModelImpl() {
}
@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 LFBigDecimal.class;
}
@Override
public String getModelClassName() {
return LFBigDecimal.class.getName();
}
@Override
public Map<String, Object> getModelAttributes() {
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("id", getId());
attributes.put("decimal", getDecimal());
attributes.put("text", getText());
return attributes;
}
@Override
public void setModelAttributes(Map<String, Object> attributes) {
Long id = (Long) attributes.get("id");
if (id != null) {
setId(id);
}
BigDecimal decimal = (BigDecimal) attributes.get("decimal");
if (decimal != null) {
setDecimal(decimal);
}
String text = (String) attributes.get("text");
if (text != null) {
setText(text);
}
}
@Override
public long getId() {
return _id;
}
@Override
public void setId(long id) {
_id = id;
}
@Override
public BigDecimal getDecimal() {
return _decimal;
}
@Override
public void setDecimal(BigDecimal decimal) {
_columnBitmask |= DECIMAL_COLUMN_BITMASK;
if (_originalDecimal == null) {
_originalDecimal = _decimal;
}
_decimal = decimal;
}
public BigDecimal getOriginalDecimal() {
return _originalDecimal;
}
@Override
public String getText() {
return _text;
}
@Override
public void setText(String text) {
_text = text;
}
public long getColumnBitmask() {
return _columnBitmask;
}
@Override
public ExpandoBridge getExpandoBridge() {
return ExpandoBridgeFactoryUtil.getExpandoBridge(0,
LFBigDecimal.class.getName(), getPrimaryKey());
}
@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
ExpandoBridge expandoBridge = getExpandoBridge();
expandoBridge.setAttributes(serviceContext);
}
@Override
public LFBigDecimal toEscapedModel() {
if (_escapedModel == null) {
_escapedModel = (LFBigDecimal) ProxyUtil.newProxyInstance(_classLoader,
_escapedModelInterfaces, new AutoEscapeBeanHandler(this));
}
return _escapedModel;
}
@Override
public Object clone() {
LFBigDecimalImpl lfBigDecimalImpl = new LFBigDecimalImpl();
lfBigDecimalImpl.setId(getId());
lfBigDecimalImpl.setDecimal(getDecimal());
lfBigDecimalImpl.setText(getText());
lfBigDecimalImpl.resetOriginalValues();
return lfBigDecimalImpl;
}
@Override
public int compareTo(LFBigDecimal lfBigDecimal) {
long primaryKey = lfBigDecimal.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 LFBigDecimal)) {
return false;
}
LFBigDecimal lfBigDecimal = (LFBigDecimal) obj;
long primaryKey = lfBigDecimal.getPrimaryKey();
if (getPrimaryKey() == primaryKey) {
return true;
} else {
return false;
}
}
@Override
public int hashCode() {
return (int) getPrimaryKey();
}
@Override
public void resetOriginalValues() {
LFBigDecimalModelImpl lfBigDecimalModelImpl = this;
lfBigDecimalModelImpl._originalDecimal = lfBigDecimalModelImpl._decimal;
lfBigDecimalModelImpl._columnBitmask = 0;
}
@Override
public CacheModel<LFBigDecimal> toCacheModel() {
LFBigDecimalCacheModel lfBigDecimalCacheModel = new LFBigDecimalCacheModel();
lfBigDecimalCacheModel.id = getId();
lfBigDecimalCacheModel.decimal = getDecimal();
lfBigDecimalCacheModel.text = getText();
String text = lfBigDecimalCacheModel.text;
if ((text != null) && (text.length() == 0)) {
lfBigDecimalCacheModel.text = null;
}
return lfBigDecimalCacheModel;
}
@Override
public String toString() {
StringBundler sb = new StringBundler(7);
sb.append("{id=");
sb.append(getId());
sb.append(", decimal=");
sb.append(getDecimal());
sb.append(", text=");
sb.append(getText());
sb.append("}");
return sb.toString();
}
@Override
public String toXmlString() {
StringBundler sb = new StringBundler(13);
sb.append("<model><model-name>");
sb.append("com.arcusys.learn.persistence.liferay.model.LFBigDecimal");
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>decimal</column-name><column-value><![CDATA[");
sb.append(getDecimal());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>text</column-name><column-value><![CDATA[");
sb.append(getText());
sb.append("]]></column-value></column>");
sb.append("</model>");
return sb.toString();
}
}