001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.expando.model;
016    
017    import com.liferay.portal.model.ModelWrapper;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link ExpandoRow}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       ExpandoRow
029     * @generated
030     */
031    public class ExpandoRowWrapper implements ExpandoRow, ModelWrapper<ExpandoRow> {
032            public ExpandoRowWrapper(ExpandoRow expandoRow) {
033                    _expandoRow = expandoRow;
034            }
035    
036            public Class<?> getModelClass() {
037                    return ExpandoRow.class;
038            }
039    
040            public String getModelClassName() {
041                    return ExpandoRow.class.getName();
042            }
043    
044            public Map<String, Object> getModelAttributes() {
045                    Map<String, Object> attributes = new HashMap<String, Object>();
046    
047                    attributes.put("rowId", getRowId());
048                    attributes.put("companyId", getCompanyId());
049                    attributes.put("tableId", getTableId());
050                    attributes.put("classPK", getClassPK());
051    
052                    return attributes;
053            }
054    
055            public void setModelAttributes(Map<String, Object> attributes) {
056                    Long rowId = (Long)attributes.get("rowId");
057    
058                    if (rowId != null) {
059                            setRowId(rowId);
060                    }
061    
062                    Long companyId = (Long)attributes.get("companyId");
063    
064                    if (companyId != null) {
065                            setCompanyId(companyId);
066                    }
067    
068                    Long tableId = (Long)attributes.get("tableId");
069    
070                    if (tableId != null) {
071                            setTableId(tableId);
072                    }
073    
074                    Long classPK = (Long)attributes.get("classPK");
075    
076                    if (classPK != null) {
077                            setClassPK(classPK);
078                    }
079            }
080    
081            /**
082            * Returns the primary key of this expando row.
083            *
084            * @return the primary key of this expando row
085            */
086            public long getPrimaryKey() {
087                    return _expandoRow.getPrimaryKey();
088            }
089    
090            /**
091            * Sets the primary key of this expando row.
092            *
093            * @param primaryKey the primary key of this expando row
094            */
095            public void setPrimaryKey(long primaryKey) {
096                    _expandoRow.setPrimaryKey(primaryKey);
097            }
098    
099            /**
100            * Returns the row ID of this expando row.
101            *
102            * @return the row ID of this expando row
103            */
104            public long getRowId() {
105                    return _expandoRow.getRowId();
106            }
107    
108            /**
109            * Sets the row ID of this expando row.
110            *
111            * @param rowId the row ID of this expando row
112            */
113            public void setRowId(long rowId) {
114                    _expandoRow.setRowId(rowId);
115            }
116    
117            /**
118            * Returns the company ID of this expando row.
119            *
120            * @return the company ID of this expando row
121            */
122            public long getCompanyId() {
123                    return _expandoRow.getCompanyId();
124            }
125    
126            /**
127            * Sets the company ID of this expando row.
128            *
129            * @param companyId the company ID of this expando row
130            */
131            public void setCompanyId(long companyId) {
132                    _expandoRow.setCompanyId(companyId);
133            }
134    
135            /**
136            * Returns the table ID of this expando row.
137            *
138            * @return the table ID of this expando row
139            */
140            public long getTableId() {
141                    return _expandoRow.getTableId();
142            }
143    
144            /**
145            * Sets the table ID of this expando row.
146            *
147            * @param tableId the table ID of this expando row
148            */
149            public void setTableId(long tableId) {
150                    _expandoRow.setTableId(tableId);
151            }
152    
153            /**
154            * Returns the class p k of this expando row.
155            *
156            * @return the class p k of this expando row
157            */
158            public long getClassPK() {
159                    return _expandoRow.getClassPK();
160            }
161    
162            /**
163            * Sets the class p k of this expando row.
164            *
165            * @param classPK the class p k of this expando row
166            */
167            public void setClassPK(long classPK) {
168                    _expandoRow.setClassPK(classPK);
169            }
170    
171            public boolean isNew() {
172                    return _expandoRow.isNew();
173            }
174    
175            public void setNew(boolean n) {
176                    _expandoRow.setNew(n);
177            }
178    
179            public boolean isCachedModel() {
180                    return _expandoRow.isCachedModel();
181            }
182    
183            public void setCachedModel(boolean cachedModel) {
184                    _expandoRow.setCachedModel(cachedModel);
185            }
186    
187            public boolean isEscapedModel() {
188                    return _expandoRow.isEscapedModel();
189            }
190    
191            public java.io.Serializable getPrimaryKeyObj() {
192                    return _expandoRow.getPrimaryKeyObj();
193            }
194    
195            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
196                    _expandoRow.setPrimaryKeyObj(primaryKeyObj);
197            }
198    
199            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
200                    return _expandoRow.getExpandoBridge();
201            }
202    
203            public void setExpandoBridgeAttributes(
204                    com.liferay.portal.service.ServiceContext serviceContext) {
205                    _expandoRow.setExpandoBridgeAttributes(serviceContext);
206            }
207    
208            @Override
209            public java.lang.Object clone() {
210                    return new ExpandoRowWrapper((ExpandoRow)_expandoRow.clone());
211            }
212    
213            public int compareTo(
214                    com.liferay.portlet.expando.model.ExpandoRow expandoRow) {
215                    return _expandoRow.compareTo(expandoRow);
216            }
217    
218            @Override
219            public int hashCode() {
220                    return _expandoRow.hashCode();
221            }
222    
223            public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoRow> toCacheModel() {
224                    return _expandoRow.toCacheModel();
225            }
226    
227            public com.liferay.portlet.expando.model.ExpandoRow toEscapedModel() {
228                    return new ExpandoRowWrapper(_expandoRow.toEscapedModel());
229            }
230    
231            @Override
232            public java.lang.String toString() {
233                    return _expandoRow.toString();
234            }
235    
236            public java.lang.String toXmlString() {
237                    return _expandoRow.toXmlString();
238            }
239    
240            public void persist()
241                    throws com.liferay.portal.kernel.exception.SystemException {
242                    _expandoRow.persist();
243            }
244    
245            /**
246             * @deprecated Renamed to {@link #getWrappedModel}
247             */
248            public ExpandoRow getWrappedExpandoRow() {
249                    return _expandoRow;
250            }
251    
252            public ExpandoRow getWrappedModel() {
253                    return _expandoRow;
254            }
255    
256            public void resetOriginalValues() {
257                    _expandoRow.resetOriginalValues();
258            }
259    
260            private ExpandoRow _expandoRow;
261    }