package com.arcusys.learn.persistence.liferay.model.impl;
import com.arcusys.learn.persistence.liferay.model.LFAttemptData;
import com.arcusys.learn.persistence.liferay.model.LFAttemptDataModel;
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.HashMap;
import java.util.Map;
/**
* The base model implementation for the LFAttemptData service. Represents a row in the "Learn_LFAttemptData" 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.LFAttemptDataModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link LFAttemptDataImpl}.
* </p>
*
* @author Brian Wing Shun Chan
* @see LFAttemptDataImpl
* @see com.arcusys.learn.persistence.liferay.model.LFAttemptData
* @see com.arcusys.learn.persistence.liferay.model.LFAttemptDataModel
* @generated
*/
public class LFAttemptDataModelImpl extends BaseModelImpl<LFAttemptData>
implements LFAttemptDataModel {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. All methods that expect a l f attempt data model instance should use the {@link com.arcusys.learn.persistence.liferay.model.LFAttemptData} interface instead.
*/
public static final String TABLE_NAME = "Learn_LFAttemptData";
public static final Object[][] TABLE_COLUMNS = {
{ "id_", Types.BIGINT },
{ "dataKey", Types.VARCHAR },
{ "dataValue", Types.CLOB },
{ "attemptID", Types.INTEGER },
{ "activityID", Types.VARCHAR }
};
public static final String TABLE_SQL_CREATE = "create table Learn_LFAttemptData (id_ LONG not null primary key,dataKey VARCHAR(3000) null,dataValue TEXT null,attemptID INTEGER null,activityID VARCHAR(3000) null)";
public static final String TABLE_SQL_DROP = "drop table Learn_LFAttemptData";
public static final String ORDER_BY_JPQL = " ORDER BY lfAttemptData.id ASC";
public static final String ORDER_BY_SQL = " ORDER BY Learn_LFAttemptData.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.LFAttemptData"),
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.LFAttemptData"),
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.LFAttemptData"),
true);
public static long ACTIVITYID_COLUMN_BITMASK = 1L;
public static long ATTEMPTID_COLUMN_BITMASK = 2L;
public static long DATAKEY_COLUMN_BITMASK = 4L;
public static long ID_COLUMN_BITMASK = 8L;
public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
"lock.expiration.time.com.arcusys.learn.persistence.liferay.model.LFAttemptData"));
private static ClassLoader _classLoader = LFAttemptData.class.getClassLoader();
private static Class<?>[] _escapedModelInterfaces = new Class[] {
LFAttemptData.class
};
private long _id;
private String _dataKey;
private String _originalDataKey;
private String _dataValue;
private Integer _attemptID;
private Integer _originalAttemptID;
private boolean _setOriginalAttemptID;
private String _activityID;
private String _originalActivityID;
private long _columnBitmask;
private LFAttemptData _escapedModel;
public LFAttemptDataModelImpl() {
}
@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 LFAttemptData.class;
}
@Override
public String getModelClassName() {
return LFAttemptData.class.getName();
}
@Override
public Map<String, Object> getModelAttributes() {
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("id", getId());
attributes.put("dataKey", getDataKey());
attributes.put("dataValue", getDataValue());
attributes.put("attemptID", getAttemptID());
attributes.put("activityID", getActivityID());
return attributes;
}
@Override
public void setModelAttributes(Map<String, Object> attributes) {
Long id = (Long) attributes.get("id");
if (id != null) {
setId(id);
}
String dataKey = (String) attributes.get("dataKey");
if (dataKey != null) {
setDataKey(dataKey);
}
String dataValue = (String) attributes.get("dataValue");
if (dataValue != null) {
setDataValue(dataValue);
}
Integer attemptID = (Integer) attributes.get("attemptID");
if (attemptID != null) {
setAttemptID(attemptID);
}
String activityID = (String) attributes.get("activityID");
if (activityID != null) {
setActivityID(activityID);
}
}
@Override
public long getId() {
return _id;
}
@Override
public void setId(long id) {
_id = id;
}
@Override
public String getDataKey() {
if (_dataKey == null) {
return StringPool.BLANK;
} else {
return _dataKey;
}
}
@Override
public void setDataKey(String dataKey) {
_columnBitmask |= DATAKEY_COLUMN_BITMASK;
if (_originalDataKey == null) {
_originalDataKey = _dataKey;
}
_dataKey = dataKey;
}
public String getOriginalDataKey() {
return GetterUtil.getString(_originalDataKey);
}
@Override
public String getDataValue() {
return _dataValue;
}
@Override
public void setDataValue(String dataValue) {
_dataValue = dataValue;
}
@Override
public Integer getAttemptID() {
return _attemptID;
}
@Override
public void setAttemptID(Integer attemptID) {
_columnBitmask |= ATTEMPTID_COLUMN_BITMASK;
if (!_setOriginalAttemptID) {
_setOriginalAttemptID = true;
_originalAttemptID = _attemptID;
}
_attemptID = attemptID;
}
public Integer getOriginalAttemptID() {
return _originalAttemptID;
}
@Override
public String getActivityID() {
if (_activityID == null) {
return StringPool.BLANK;
} else {
return _activityID;
}
}
@Override
public void setActivityID(String activityID) {
_columnBitmask |= ACTIVITYID_COLUMN_BITMASK;
if (_originalActivityID == null) {
_originalActivityID = _activityID;
}
_activityID = activityID;
}
public String getOriginalActivityID() {
return GetterUtil.getString(_originalActivityID);
}
public long getColumnBitmask() {
return _columnBitmask;
}
@Override
public ExpandoBridge getExpandoBridge() {
return ExpandoBridgeFactoryUtil.getExpandoBridge(0,
LFAttemptData.class.getName(), getPrimaryKey());
}
@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
ExpandoBridge expandoBridge = getExpandoBridge();
expandoBridge.setAttributes(serviceContext);
}
@Override
public LFAttemptData toEscapedModel() {
if (_escapedModel == null) {
_escapedModel = (LFAttemptData) ProxyUtil.newProxyInstance(_classLoader,
_escapedModelInterfaces, new AutoEscapeBeanHandler(this));
}
return _escapedModel;
}
@Override
public Object clone() {
LFAttemptDataImpl lfAttemptDataImpl = new LFAttemptDataImpl();
lfAttemptDataImpl.setId(getId());
lfAttemptDataImpl.setDataKey(getDataKey());
lfAttemptDataImpl.setDataValue(getDataValue());
lfAttemptDataImpl.setAttemptID(getAttemptID());
lfAttemptDataImpl.setActivityID(getActivityID());
lfAttemptDataImpl.resetOriginalValues();
return lfAttemptDataImpl;
}
@Override
public int compareTo(LFAttemptData lfAttemptData) {
long primaryKey = lfAttemptData.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 LFAttemptData)) {
return false;
}
LFAttemptData lfAttemptData = (LFAttemptData) obj;
long primaryKey = lfAttemptData.getPrimaryKey();
if (getPrimaryKey() == primaryKey) {
return true;
} else {
return false;
}
}
@Override
public int hashCode() {
return (int) getPrimaryKey();
}
@Override
public void resetOriginalValues() {
LFAttemptDataModelImpl lfAttemptDataModelImpl = this;
lfAttemptDataModelImpl._originalDataKey = lfAttemptDataModelImpl._dataKey;
lfAttemptDataModelImpl._originalAttemptID = lfAttemptDataModelImpl._attemptID;
lfAttemptDataModelImpl._setOriginalAttemptID = false;
lfAttemptDataModelImpl._originalActivityID = lfAttemptDataModelImpl._activityID;
lfAttemptDataModelImpl._columnBitmask = 0;
}
@Override
public CacheModel<LFAttemptData> toCacheModel() {
LFAttemptDataCacheModel lfAttemptDataCacheModel = new LFAttemptDataCacheModel();
lfAttemptDataCacheModel.id = getId();
lfAttemptDataCacheModel.dataKey = getDataKey();
String dataKey = lfAttemptDataCacheModel.dataKey;
if ((dataKey != null) && (dataKey.length() == 0)) {
lfAttemptDataCacheModel.dataKey = null;
}
lfAttemptDataCacheModel.dataValue = getDataValue();
String dataValue = lfAttemptDataCacheModel.dataValue;
if ((dataValue != null) && (dataValue.length() == 0)) {
lfAttemptDataCacheModel.dataValue = null;
}
lfAttemptDataCacheModel.attemptID = getAttemptID();
lfAttemptDataCacheModel.activityID = getActivityID();
String activityID = lfAttemptDataCacheModel.activityID;
if ((activityID != null) && (activityID.length() == 0)) {
lfAttemptDataCacheModel.activityID = null;
}
return lfAttemptDataCacheModel;
}
@Override
public String toString() {
StringBundler sb = new StringBundler(11);
sb.append("{id=");
sb.append(getId());
sb.append(", dataKey=");
sb.append(getDataKey());
sb.append(", dataValue=");
sb.append(getDataValue());
sb.append(", attemptID=");
sb.append(getAttemptID());
sb.append(", activityID=");
sb.append(getActivityID());
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.LFAttemptData");
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>dataKey</column-name><column-value><![CDATA[");
sb.append(getDataKey());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>dataValue</column-name><column-value><![CDATA[");
sb.append(getDataValue());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>attemptID</column-name><column-value><![CDATA[");
sb.append(getAttemptID());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>activityID</column-name><column-value><![CDATA[");
sb.append(getActivityID());
sb.append("]]></column-value></column>");
sb.append("</model>");
return sb.toString();
}
}