001
014
015 package com.liferay.portlet.expando.model.impl;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.kernel.util.StringPool;
019 import com.liferay.portal.model.CacheModel;
020
021 import com.liferay.portlet.expando.model.ExpandoColumn;
022
023 import java.io.Serializable;
024
025
032 public class ExpandoColumnCacheModel implements CacheModel<ExpandoColumn>,
033 Serializable {
034 @Override
035 public String toString() {
036 StringBundler sb = new StringBundler(15);
037
038 sb.append("{columnId=");
039 sb.append(columnId);
040 sb.append(", companyId=");
041 sb.append(companyId);
042 sb.append(", tableId=");
043 sb.append(tableId);
044 sb.append(", name=");
045 sb.append(name);
046 sb.append(", type=");
047 sb.append(type);
048 sb.append(", defaultData=");
049 sb.append(defaultData);
050 sb.append(", typeSettings=");
051 sb.append(typeSettings);
052 sb.append("}");
053
054 return sb.toString();
055 }
056
057 public ExpandoColumn toEntityModel() {
058 ExpandoColumnImpl expandoColumnImpl = new ExpandoColumnImpl();
059
060 expandoColumnImpl.setColumnId(columnId);
061 expandoColumnImpl.setCompanyId(companyId);
062 expandoColumnImpl.setTableId(tableId);
063
064 if (name == null) {
065 expandoColumnImpl.setName(StringPool.BLANK);
066 }
067 else {
068 expandoColumnImpl.setName(name);
069 }
070
071 expandoColumnImpl.setType(type);
072
073 if (defaultData == null) {
074 expandoColumnImpl.setDefaultData(StringPool.BLANK);
075 }
076 else {
077 expandoColumnImpl.setDefaultData(defaultData);
078 }
079
080 if (typeSettings == null) {
081 expandoColumnImpl.setTypeSettings(StringPool.BLANK);
082 }
083 else {
084 expandoColumnImpl.setTypeSettings(typeSettings);
085 }
086
087 expandoColumnImpl.resetOriginalValues();
088
089 return expandoColumnImpl;
090 }
091
092 public long columnId;
093 public long companyId;
094 public long tableId;
095 public String name;
096 public int type;
097 public String defaultData;
098 public String typeSettings;
099 }