001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.expando.model;
016    
017    import com.liferay.portal.model.ModelWrapper;
018    
019    import java.util.Date;
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link ExpandoRow}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       ExpandoRow
030     * @generated
031     */
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("modifiedDate", getModifiedDate());
051                    attributes.put("tableId", getTableId());
052                    attributes.put("classPK", getClassPK());
053    
054                    return attributes;
055            }
056    
057            public void setModelAttributes(Map<String, Object> attributes) {
058                    Long rowId = (Long)attributes.get("rowId");
059    
060                    if (rowId != null) {
061                            setRowId(rowId);
062                    }
063    
064                    Long companyId = (Long)attributes.get("companyId");
065    
066                    if (companyId != null) {
067                            setCompanyId(companyId);
068                    }
069    
070                    Date modifiedDate = (Date)attributes.get("modifiedDate");
071    
072                    if (modifiedDate != null) {
073                            setModifiedDate(modifiedDate);
074                    }
075    
076                    Long tableId = (Long)attributes.get("tableId");
077    
078                    if (tableId != null) {
079                            setTableId(tableId);
080                    }
081    
082                    Long classPK = (Long)attributes.get("classPK");
083    
084                    if (classPK != null) {
085                            setClassPK(classPK);
086                    }
087            }
088    
089            /**
090            * Returns the primary key of this expando row.
091            *
092            * @return the primary key of this expando row
093            */
094            public long getPrimaryKey() {
095                    return _expandoRow.getPrimaryKey();
096            }
097    
098            /**
099            * Sets the primary key of this expando row.
100            *
101            * @param primaryKey the primary key of this expando row
102            */
103            public void setPrimaryKey(long primaryKey) {
104                    _expandoRow.setPrimaryKey(primaryKey);
105            }
106    
107            /**
108            * Returns the row ID of this expando row.
109            *
110            * @return the row ID of this expando row
111            */
112            public long getRowId() {
113                    return _expandoRow.getRowId();
114            }
115    
116            /**
117            * Sets the row ID of this expando row.
118            *
119            * @param rowId the row ID of this expando row
120            */
121            public void setRowId(long rowId) {
122                    _expandoRow.setRowId(rowId);
123            }
124    
125            /**
126            * Returns the company ID of this expando row.
127            *
128            * @return the company ID of this expando row
129            */
130            public long getCompanyId() {
131                    return _expandoRow.getCompanyId();
132            }
133    
134            /**
135            * Sets the company ID of this expando row.
136            *
137            * @param companyId the company ID of this expando row
138            */
139            public void setCompanyId(long companyId) {
140                    _expandoRow.setCompanyId(companyId);
141            }
142    
143            /**
144            * Returns the modified date of this expando row.
145            *
146            * @return the modified date of this expando row
147            */
148            public java.util.Date getModifiedDate() {
149                    return _expandoRow.getModifiedDate();
150            }
151    
152            /**
153            * Sets the modified date of this expando row.
154            *
155            * @param modifiedDate the modified date of this expando row
156            */
157            public void setModifiedDate(java.util.Date modifiedDate) {
158                    _expandoRow.setModifiedDate(modifiedDate);
159            }
160    
161            /**
162            * Returns the table ID of this expando row.
163            *
164            * @return the table ID of this expando row
165            */
166            public long getTableId() {
167                    return _expandoRow.getTableId();
168            }
169    
170            /**
171            * Sets the table ID of this expando row.
172            *
173            * @param tableId the table ID of this expando row
174            */
175            public void setTableId(long tableId) {
176                    _expandoRow.setTableId(tableId);
177            }
178    
179            /**
180            * Returns the class p k of this expando row.
181            *
182            * @return the class p k of this expando row
183            */
184            public long getClassPK() {
185                    return _expandoRow.getClassPK();
186            }
187    
188            /**
189            * Sets the class p k of this expando row.
190            *
191            * @param classPK the class p k of this expando row
192            */
193            public void setClassPK(long classPK) {
194                    _expandoRow.setClassPK(classPK);
195            }
196    
197            public boolean isNew() {
198                    return _expandoRow.isNew();
199            }
200    
201            public void setNew(boolean n) {
202                    _expandoRow.setNew(n);
203            }
204    
205            public boolean isCachedModel() {
206                    return _expandoRow.isCachedModel();
207            }
208    
209            public void setCachedModel(boolean cachedModel) {
210                    _expandoRow.setCachedModel(cachedModel);
211            }
212    
213            public boolean isEscapedModel() {
214                    return _expandoRow.isEscapedModel();
215            }
216    
217            public java.io.Serializable getPrimaryKeyObj() {
218                    return _expandoRow.getPrimaryKeyObj();
219            }
220    
221            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
222                    _expandoRow.setPrimaryKeyObj(primaryKeyObj);
223            }
224    
225            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
226                    return _expandoRow.getExpandoBridge();
227            }
228    
229            public void setExpandoBridgeAttributes(
230                    com.liferay.portal.service.ServiceContext serviceContext) {
231                    _expandoRow.setExpandoBridgeAttributes(serviceContext);
232            }
233    
234            @Override
235            public java.lang.Object clone() {
236                    return new ExpandoRowWrapper((ExpandoRow)_expandoRow.clone());
237            }
238    
239            public int compareTo(
240                    com.liferay.portlet.expando.model.ExpandoRow expandoRow) {
241                    return _expandoRow.compareTo(expandoRow);
242            }
243    
244            @Override
245            public int hashCode() {
246                    return _expandoRow.hashCode();
247            }
248    
249            public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoRow> toCacheModel() {
250                    return _expandoRow.toCacheModel();
251            }
252    
253            public com.liferay.portlet.expando.model.ExpandoRow toEscapedModel() {
254                    return new ExpandoRowWrapper(_expandoRow.toEscapedModel());
255            }
256    
257            @Override
258            public java.lang.String toString() {
259                    return _expandoRow.toString();
260            }
261    
262            public java.lang.String toXmlString() {
263                    return _expandoRow.toXmlString();
264            }
265    
266            public void persist()
267                    throws com.liferay.portal.kernel.exception.SystemException {
268                    _expandoRow.persist();
269            }
270    
271            /**
272             * @deprecated Renamed to {@link #getWrappedModel}
273             */
274            public ExpandoRow getWrappedExpandoRow() {
275                    return _expandoRow;
276            }
277    
278            public ExpandoRow getWrappedModel() {
279                    return _expandoRow;
280            }
281    
282            public void resetOriginalValues() {
283                    _expandoRow.resetOriginalValues();
284            }
285    
286            private ExpandoRow _expandoRow;
287    }