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 ExpandoTableWrapper implements ExpandoTable,
033 ModelWrapper<ExpandoTable> {
034 public ExpandoTableWrapper(ExpandoTable expandoTable) {
035 _expandoTable = expandoTable;
036 }
037
038 public Class<?> getModelClass() {
039 return ExpandoTable.class;
040 }
041
042 public String getModelClassName() {
043 return ExpandoTable.class.getName();
044 }
045
046 public Map<String, Object> getModelAttributes() {
047 Map<String, Object> attributes = new HashMap<String, Object>();
048
049 attributes.put("tableId", getTableId());
050 attributes.put("companyId", getCompanyId());
051 attributes.put("classNameId", getClassNameId());
052 attributes.put("name", getName());
053
054 return attributes;
055 }
056
057 public void setModelAttributes(Map<String, Object> attributes) {
058 Long tableId = (Long)attributes.get("tableId");
059
060 if (tableId != null) {
061 setTableId(tableId);
062 }
063
064 Long companyId = (Long)attributes.get("companyId");
065
066 if (companyId != null) {
067 setCompanyId(companyId);
068 }
069
070 Long classNameId = (Long)attributes.get("classNameId");
071
072 if (classNameId != null) {
073 setClassNameId(classNameId);
074 }
075
076 String name = (String)attributes.get("name");
077
078 if (name != null) {
079 setName(name);
080 }
081 }
082
083
088 public long getPrimaryKey() {
089 return _expandoTable.getPrimaryKey();
090 }
091
092
097 public void setPrimaryKey(long primaryKey) {
098 _expandoTable.setPrimaryKey(primaryKey);
099 }
100
101
106 public long getTableId() {
107 return _expandoTable.getTableId();
108 }
109
110
115 public void setTableId(long tableId) {
116 _expandoTable.setTableId(tableId);
117 }
118
119
124 public long getCompanyId() {
125 return _expandoTable.getCompanyId();
126 }
127
128
133 public void setCompanyId(long companyId) {
134 _expandoTable.setCompanyId(companyId);
135 }
136
137
142 public java.lang.String getClassName() {
143 return _expandoTable.getClassName();
144 }
145
146 public void setClassName(java.lang.String className) {
147 _expandoTable.setClassName(className);
148 }
149
150
155 public long getClassNameId() {
156 return _expandoTable.getClassNameId();
157 }
158
159
164 public void setClassNameId(long classNameId) {
165 _expandoTable.setClassNameId(classNameId);
166 }
167
168
173 public java.lang.String getName() {
174 return _expandoTable.getName();
175 }
176
177
182 public void setName(java.lang.String name) {
183 _expandoTable.setName(name);
184 }
185
186 public boolean isNew() {
187 return _expandoTable.isNew();
188 }
189
190 public void setNew(boolean n) {
191 _expandoTable.setNew(n);
192 }
193
194 public boolean isCachedModel() {
195 return _expandoTable.isCachedModel();
196 }
197
198 public void setCachedModel(boolean cachedModel) {
199 _expandoTable.setCachedModel(cachedModel);
200 }
201
202 public boolean isEscapedModel() {
203 return _expandoTable.isEscapedModel();
204 }
205
206 public java.io.Serializable getPrimaryKeyObj() {
207 return _expandoTable.getPrimaryKeyObj();
208 }
209
210 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
211 _expandoTable.setPrimaryKeyObj(primaryKeyObj);
212 }
213
214 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
215 return _expandoTable.getExpandoBridge();
216 }
217
218 public void setExpandoBridgeAttributes(
219 com.liferay.portal.service.ServiceContext serviceContext) {
220 _expandoTable.setExpandoBridgeAttributes(serviceContext);
221 }
222
223 @Override
224 public java.lang.Object clone() {
225 return new ExpandoTableWrapper((ExpandoTable)_expandoTable.clone());
226 }
227
228 public int compareTo(
229 com.liferay.portlet.expando.model.ExpandoTable expandoTable) {
230 return _expandoTable.compareTo(expandoTable);
231 }
232
233 @Override
234 public int hashCode() {
235 return _expandoTable.hashCode();
236 }
237
238 public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoTable> toCacheModel() {
239 return _expandoTable.toCacheModel();
240 }
241
242 public com.liferay.portlet.expando.model.ExpandoTable toEscapedModel() {
243 return new ExpandoTableWrapper(_expandoTable.toEscapedModel());
244 }
245
246 public com.liferay.portlet.expando.model.ExpandoTable toUnescapedModel() {
247 return new ExpandoTableWrapper(_expandoTable.toUnescapedModel());
248 }
249
250 @Override
251 public java.lang.String toString() {
252 return _expandoTable.toString();
253 }
254
255 public java.lang.String toXmlString() {
256 return _expandoTable.toXmlString();
257 }
258
259 public void persist()
260 throws com.liferay.portal.kernel.exception.SystemException {
261 _expandoTable.persist();
262 }
263
264 public boolean isDefaultTable() {
265 return _expandoTable.isDefaultTable();
266 }
267
268 @Override
269 public boolean equals(Object obj) {
270 if (this == obj) {
271 return true;
272 }
273
274 if (!(obj instanceof ExpandoTableWrapper)) {
275 return false;
276 }
277
278 ExpandoTableWrapper expandoTableWrapper = (ExpandoTableWrapper)obj;
279
280 if (Validator.equals(_expandoTable, expandoTableWrapper._expandoTable)) {
281 return true;
282 }
283
284 return false;
285 }
286
287
290 public ExpandoTable getWrappedExpandoTable() {
291 return _expandoTable;
292 }
293
294 public ExpandoTable getWrappedModel() {
295 return _expandoTable;
296 }
297
298 public void resetOriginalValues() {
299 _expandoTable.resetOriginalValues();
300 }
301
302 private ExpandoTable _expandoTable;
303 }