001
014
015 package com.liferay.portlet.expando.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018 import com.liferay.portal.model.ModelWrapper;
019
020 import java.util.HashMap;
021 import java.util.Map;
022
023
032 public class ExpandoRowWrapper implements ExpandoRow, ModelWrapper<ExpandoRow> {
033 public ExpandoRowWrapper(ExpandoRow expandoRow) {
034 _expandoRow = expandoRow;
035 }
036
037 public Class<?> getModelClass() {
038 return ExpandoRow.class;
039 }
040
041 public String getModelClassName() {
042 return ExpandoRow.class.getName();
043 }
044
045 public Map<String, Object> getModelAttributes() {
046 Map<String, Object> attributes = new HashMap<String, Object>();
047
048 attributes.put("rowId", getRowId());
049 attributes.put("companyId", getCompanyId());
050 attributes.put("tableId", getTableId());
051 attributes.put("classPK", getClassPK());
052
053 return attributes;
054 }
055
056 public void setModelAttributes(Map<String, Object> attributes) {
057 Long rowId = (Long)attributes.get("rowId");
058
059 if (rowId != null) {
060 setRowId(rowId);
061 }
062
063 Long companyId = (Long)attributes.get("companyId");
064
065 if (companyId != null) {
066 setCompanyId(companyId);
067 }
068
069 Long tableId = (Long)attributes.get("tableId");
070
071 if (tableId != null) {
072 setTableId(tableId);
073 }
074
075 Long classPK = (Long)attributes.get("classPK");
076
077 if (classPK != null) {
078 setClassPK(classPK);
079 }
080 }
081
082
087 public long getPrimaryKey() {
088 return _expandoRow.getPrimaryKey();
089 }
090
091
096 public void setPrimaryKey(long primaryKey) {
097 _expandoRow.setPrimaryKey(primaryKey);
098 }
099
100
105 public long getRowId() {
106 return _expandoRow.getRowId();
107 }
108
109
114 public void setRowId(long rowId) {
115 _expandoRow.setRowId(rowId);
116 }
117
118
123 public long getCompanyId() {
124 return _expandoRow.getCompanyId();
125 }
126
127
132 public void setCompanyId(long companyId) {
133 _expandoRow.setCompanyId(companyId);
134 }
135
136
141 public long getTableId() {
142 return _expandoRow.getTableId();
143 }
144
145
150 public void setTableId(long tableId) {
151 _expandoRow.setTableId(tableId);
152 }
153
154
159 public long getClassPK() {
160 return _expandoRow.getClassPK();
161 }
162
163
168 public void setClassPK(long classPK) {
169 _expandoRow.setClassPK(classPK);
170 }
171
172 public boolean isNew() {
173 return _expandoRow.isNew();
174 }
175
176 public void setNew(boolean n) {
177 _expandoRow.setNew(n);
178 }
179
180 public boolean isCachedModel() {
181 return _expandoRow.isCachedModel();
182 }
183
184 public void setCachedModel(boolean cachedModel) {
185 _expandoRow.setCachedModel(cachedModel);
186 }
187
188 public boolean isEscapedModel() {
189 return _expandoRow.isEscapedModel();
190 }
191
192 public java.io.Serializable getPrimaryKeyObj() {
193 return _expandoRow.getPrimaryKeyObj();
194 }
195
196 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
197 _expandoRow.setPrimaryKeyObj(primaryKeyObj);
198 }
199
200 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
201 return _expandoRow.getExpandoBridge();
202 }
203
204 public void setExpandoBridgeAttributes(
205 com.liferay.portal.service.ServiceContext serviceContext) {
206 _expandoRow.setExpandoBridgeAttributes(serviceContext);
207 }
208
209 @Override
210 public java.lang.Object clone() {
211 return new ExpandoRowWrapper((ExpandoRow)_expandoRow.clone());
212 }
213
214 public int compareTo(
215 com.liferay.portlet.expando.model.ExpandoRow expandoRow) {
216 return _expandoRow.compareTo(expandoRow);
217 }
218
219 @Override
220 public int hashCode() {
221 return _expandoRow.hashCode();
222 }
223
224 public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoRow> toCacheModel() {
225 return _expandoRow.toCacheModel();
226 }
227
228 public com.liferay.portlet.expando.model.ExpandoRow toEscapedModel() {
229 return new ExpandoRowWrapper(_expandoRow.toEscapedModel());
230 }
231
232 public com.liferay.portlet.expando.model.ExpandoRow toUnescapedModel() {
233 return new ExpandoRowWrapper(_expandoRow.toUnescapedModel());
234 }
235
236 @Override
237 public java.lang.String toString() {
238 return _expandoRow.toString();
239 }
240
241 public java.lang.String toXmlString() {
242 return _expandoRow.toXmlString();
243 }
244
245 public void persist()
246 throws com.liferay.portal.kernel.exception.SystemException {
247 _expandoRow.persist();
248 }
249
250 @Override
251 public boolean equals(Object obj) {
252 if (this == obj) {
253 return true;
254 }
255
256 if (!(obj instanceof ExpandoRowWrapper)) {
257 return false;
258 }
259
260 ExpandoRowWrapper expandoRowWrapper = (ExpandoRowWrapper)obj;
261
262 if (Validator.equals(_expandoRow, expandoRowWrapper._expandoRow)) {
263 return true;
264 }
265
266 return false;
267 }
268
269
272 public ExpandoRow getWrappedExpandoRow() {
273 return _expandoRow;
274 }
275
276 public ExpandoRow getWrappedModel() {
277 return _expandoRow;
278 }
279
280 public void resetOriginalValues() {
281 _expandoRow.resetOriginalValues();
282 }
283
284 private ExpandoRow _expandoRow;
285 }