001
014
015 package com.liferay.portlet.dynamicdatamapping.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.dynamicdatamapping.model.DDMStructure;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class DDMStructureCacheModel implements CacheModel<DDMStructure>,
035 Serializable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(31);
039
040 sb.append("{uuid=");
041 sb.append(uuid);
042 sb.append(", structureId=");
043 sb.append(structureId);
044 sb.append(", groupId=");
045 sb.append(groupId);
046 sb.append(", companyId=");
047 sb.append(companyId);
048 sb.append(", userId=");
049 sb.append(userId);
050 sb.append(", userName=");
051 sb.append(userName);
052 sb.append(", createDate=");
053 sb.append(createDate);
054 sb.append(", modifiedDate=");
055 sb.append(modifiedDate);
056 sb.append(", classNameId=");
057 sb.append(classNameId);
058 sb.append(", structureKey=");
059 sb.append(structureKey);
060 sb.append(", name=");
061 sb.append(name);
062 sb.append(", description=");
063 sb.append(description);
064 sb.append(", xsd=");
065 sb.append(xsd);
066 sb.append(", storageType=");
067 sb.append(storageType);
068 sb.append(", type=");
069 sb.append(type);
070 sb.append("}");
071
072 return sb.toString();
073 }
074
075 public DDMStructure toEntityModel() {
076 DDMStructureImpl ddmStructureImpl = new DDMStructureImpl();
077
078 if (uuid == null) {
079 ddmStructureImpl.setUuid(StringPool.BLANK);
080 }
081 else {
082 ddmStructureImpl.setUuid(uuid);
083 }
084
085 ddmStructureImpl.setStructureId(structureId);
086 ddmStructureImpl.setGroupId(groupId);
087 ddmStructureImpl.setCompanyId(companyId);
088 ddmStructureImpl.setUserId(userId);
089
090 if (userName == null) {
091 ddmStructureImpl.setUserName(StringPool.BLANK);
092 }
093 else {
094 ddmStructureImpl.setUserName(userName);
095 }
096
097 if (createDate == Long.MIN_VALUE) {
098 ddmStructureImpl.setCreateDate(null);
099 }
100 else {
101 ddmStructureImpl.setCreateDate(new Date(createDate));
102 }
103
104 if (modifiedDate == Long.MIN_VALUE) {
105 ddmStructureImpl.setModifiedDate(null);
106 }
107 else {
108 ddmStructureImpl.setModifiedDate(new Date(modifiedDate));
109 }
110
111 ddmStructureImpl.setClassNameId(classNameId);
112
113 if (structureKey == null) {
114 ddmStructureImpl.setStructureKey(StringPool.BLANK);
115 }
116 else {
117 ddmStructureImpl.setStructureKey(structureKey);
118 }
119
120 if (name == null) {
121 ddmStructureImpl.setName(StringPool.BLANK);
122 }
123 else {
124 ddmStructureImpl.setName(name);
125 }
126
127 if (description == null) {
128 ddmStructureImpl.setDescription(StringPool.BLANK);
129 }
130 else {
131 ddmStructureImpl.setDescription(description);
132 }
133
134 if (xsd == null) {
135 ddmStructureImpl.setXsd(StringPool.BLANK);
136 }
137 else {
138 ddmStructureImpl.setXsd(xsd);
139 }
140
141 if (storageType == null) {
142 ddmStructureImpl.setStorageType(StringPool.BLANK);
143 }
144 else {
145 ddmStructureImpl.setStorageType(storageType);
146 }
147
148 ddmStructureImpl.setType(type);
149
150 ddmStructureImpl.resetOriginalValues();
151
152 ddmStructureImpl.setDocument(_document);
153
154 ddmStructureImpl.setLocalizedFieldsMap(_localizedFieldsMap);
155
156 ddmStructureImpl.setLocalizedTransientFieldsMap(_localizedTransientFieldsMap);
157
158 return ddmStructureImpl;
159 }
160
161 public String uuid;
162 public long structureId;
163 public long groupId;
164 public long companyId;
165 public long userId;
166 public String userName;
167 public long createDate;
168 public long modifiedDate;
169 public long classNameId;
170 public String structureKey;
171 public String name;
172 public String description;
173 public String xsd;
174 public String storageType;
175 public int type;
176 public com.liferay.portal.kernel.xml.Document _document;
177 public java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>>> _localizedFieldsMap;
178 public java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>>> _localizedTransientFieldsMap;
179 }