001    /**
002     * Copyright (c) 2000-2010 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.social.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.util.GetterUtil;
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.kernel.util.StringPool;
021    import com.liferay.portal.model.impl.BaseModelImpl;
022    import com.liferay.portal.service.ServiceContext;
023    import com.liferay.portal.util.PortalUtil;
024    
025    import com.liferay.portlet.expando.model.ExpandoBridge;
026    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
027    import com.liferay.portlet.social.model.SocialEquityGroupSetting;
028    import com.liferay.portlet.social.model.SocialEquityGroupSettingModel;
029    
030    import java.io.Serializable;
031    
032    import java.lang.reflect.Proxy;
033    
034    import java.sql.Types;
035    
036    /**
037     * The base model implementation for the SocialEquityGroupSetting service. Represents a row in the "SocialEquityGroupSetting" database table, with each column mapped to a property of this class.
038     *
039     * <p>
040     * This implementation and its corresponding interface {@link com.liferay.portlet.social.model.SocialEquityGroupSettingModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link SocialEquityGroupSettingImpl}.
041     * </p>
042     *
043     * <p>
044     * Never modify or reference this class directly. All methods that expect a social equity group setting model instance should use the {@link com.liferay.portlet.social.model.SocialEquityGroupSetting} interface instead.
045     * </p>
046     *
047     * @author Brian Wing Shun Chan
048     * @see SocialEquityGroupSettingImpl
049     * @see com.liferay.portlet.social.model.SocialEquityGroupSetting
050     * @see com.liferay.portlet.social.model.SocialEquityGroupSettingModel
051     * @generated
052     */
053    public class SocialEquityGroupSettingModelImpl extends BaseModelImpl<SocialEquityGroupSetting>
054            implements SocialEquityGroupSettingModel {
055            public static final String TABLE_NAME = "SocialEquityGroupSetting";
056            public static final Object[][] TABLE_COLUMNS = {
057                            { "equityGroupSettingId", new Integer(Types.BIGINT) },
058                            { "groupId", new Integer(Types.BIGINT) },
059                            { "companyId", new Integer(Types.BIGINT) },
060                            { "classNameId", new Integer(Types.BIGINT) },
061                            { "type_", new Integer(Types.INTEGER) },
062                            { "enabled", new Integer(Types.BOOLEAN) }
063                    };
064            public static final String TABLE_SQL_CREATE = "create table SocialEquityGroupSetting (equityGroupSettingId LONG not null primary key,groupId LONG,companyId LONG,classNameId LONG,type_ INTEGER,enabled BOOLEAN)";
065            public static final String TABLE_SQL_DROP = "drop table SocialEquityGroupSetting";
066            public static final String DATA_SOURCE = "liferayDataSource";
067            public static final String SESSION_FACTORY = "liferaySessionFactory";
068            public static final String TX_MANAGER = "liferayTransactionManager";
069            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
070                                    "value.object.entity.cache.enabled.com.liferay.portlet.social.model.SocialEquityGroupSetting"),
071                            true);
072            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
073                                    "value.object.finder.cache.enabled.com.liferay.portlet.social.model.SocialEquityGroupSetting"),
074                            true);
075            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
076                                    "lock.expiration.time.com.liferay.portlet.social.model.SocialEquityGroupSetting"));
077    
078            public SocialEquityGroupSettingModelImpl() {
079            }
080    
081            public long getPrimaryKey() {
082                    return _equityGroupSettingId;
083            }
084    
085            public void setPrimaryKey(long pk) {
086                    setEquityGroupSettingId(pk);
087            }
088    
089            public Serializable getPrimaryKeyObj() {
090                    return new Long(_equityGroupSettingId);
091            }
092    
093            public long getEquityGroupSettingId() {
094                    return _equityGroupSettingId;
095            }
096    
097            public void setEquityGroupSettingId(long equityGroupSettingId) {
098                    _equityGroupSettingId = equityGroupSettingId;
099            }
100    
101            public long getGroupId() {
102                    return _groupId;
103            }
104    
105            public void setGroupId(long groupId) {
106                    _groupId = groupId;
107    
108                    if (!_setOriginalGroupId) {
109                            _setOriginalGroupId = true;
110    
111                            _originalGroupId = groupId;
112                    }
113            }
114    
115            public long getOriginalGroupId() {
116                    return _originalGroupId;
117            }
118    
119            public long getCompanyId() {
120                    return _companyId;
121            }
122    
123            public void setCompanyId(long companyId) {
124                    _companyId = companyId;
125            }
126    
127            public String getClassName() {
128                    if (getClassNameId() <= 0) {
129                            return StringPool.BLANK;
130                    }
131    
132                    return PortalUtil.getClassName(getClassNameId());
133            }
134    
135            public long getClassNameId() {
136                    return _classNameId;
137            }
138    
139            public void setClassNameId(long classNameId) {
140                    _classNameId = classNameId;
141    
142                    if (!_setOriginalClassNameId) {
143                            _setOriginalClassNameId = true;
144    
145                            _originalClassNameId = classNameId;
146                    }
147            }
148    
149            public long getOriginalClassNameId() {
150                    return _originalClassNameId;
151            }
152    
153            public int getType() {
154                    return _type;
155            }
156    
157            public void setType(int type) {
158                    _type = type;
159    
160                    if (!_setOriginalType) {
161                            _setOriginalType = true;
162    
163                            _originalType = type;
164                    }
165            }
166    
167            public int getOriginalType() {
168                    return _originalType;
169            }
170    
171            public boolean getEnabled() {
172                    return _enabled;
173            }
174    
175            public boolean isEnabled() {
176                    return _enabled;
177            }
178    
179            public void setEnabled(boolean enabled) {
180                    _enabled = enabled;
181            }
182    
183            public SocialEquityGroupSetting toEscapedModel() {
184                    if (isEscapedModel()) {
185                            return (SocialEquityGroupSetting)this;
186                    }
187                    else {
188                            return (SocialEquityGroupSetting)Proxy.newProxyInstance(SocialEquityGroupSetting.class.getClassLoader(),
189                                    new Class[] { SocialEquityGroupSetting.class },
190                                    new AutoEscapeBeanHandler(this));
191                    }
192            }
193    
194            public ExpandoBridge getExpandoBridge() {
195                    if (_expandoBridge == null) {
196                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
197                                            SocialEquityGroupSetting.class.getName(), getPrimaryKey());
198                    }
199    
200                    return _expandoBridge;
201            }
202    
203            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
204                    getExpandoBridge().setAttributes(serviceContext);
205            }
206    
207            public Object clone() {
208                    SocialEquityGroupSettingImpl clone = new SocialEquityGroupSettingImpl();
209    
210                    clone.setEquityGroupSettingId(getEquityGroupSettingId());
211                    clone.setGroupId(getGroupId());
212                    clone.setCompanyId(getCompanyId());
213                    clone.setClassNameId(getClassNameId());
214                    clone.setType(getType());
215                    clone.setEnabled(getEnabled());
216    
217                    return clone;
218            }
219    
220            public int compareTo(SocialEquityGroupSetting socialEquityGroupSetting) {
221                    long pk = socialEquityGroupSetting.getPrimaryKey();
222    
223                    if (getPrimaryKey() < pk) {
224                            return -1;
225                    }
226                    else if (getPrimaryKey() > pk) {
227                            return 1;
228                    }
229                    else {
230                            return 0;
231                    }
232            }
233    
234            public boolean equals(Object obj) {
235                    if (obj == null) {
236                            return false;
237                    }
238    
239                    SocialEquityGroupSetting socialEquityGroupSetting = null;
240    
241                    try {
242                            socialEquityGroupSetting = (SocialEquityGroupSetting)obj;
243                    }
244                    catch (ClassCastException cce) {
245                            return false;
246                    }
247    
248                    long pk = socialEquityGroupSetting.getPrimaryKey();
249    
250                    if (getPrimaryKey() == pk) {
251                            return true;
252                    }
253                    else {
254                            return false;
255                    }
256            }
257    
258            public int hashCode() {
259                    return (int)getPrimaryKey();
260            }
261    
262            public String toString() {
263                    StringBundler sb = new StringBundler(13);
264    
265                    sb.append("{equityGroupSettingId=");
266                    sb.append(getEquityGroupSettingId());
267                    sb.append(", groupId=");
268                    sb.append(getGroupId());
269                    sb.append(", companyId=");
270                    sb.append(getCompanyId());
271                    sb.append(", classNameId=");
272                    sb.append(getClassNameId());
273                    sb.append(", type=");
274                    sb.append(getType());
275                    sb.append(", enabled=");
276                    sb.append(getEnabled());
277                    sb.append("}");
278    
279                    return sb.toString();
280            }
281    
282            public String toXmlString() {
283                    StringBundler sb = new StringBundler(22);
284    
285                    sb.append("<model><model-name>");
286                    sb.append("com.liferay.portlet.social.model.SocialEquityGroupSetting");
287                    sb.append("</model-name>");
288    
289                    sb.append(
290                            "<column><column-name>equityGroupSettingId</column-name><column-value><![CDATA[");
291                    sb.append(getEquityGroupSettingId());
292                    sb.append("]]></column-value></column>");
293                    sb.append(
294                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
295                    sb.append(getGroupId());
296                    sb.append("]]></column-value></column>");
297                    sb.append(
298                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
299                    sb.append(getCompanyId());
300                    sb.append("]]></column-value></column>");
301                    sb.append(
302                            "<column><column-name>classNameId</column-name><column-value><![CDATA[");
303                    sb.append(getClassNameId());
304                    sb.append("]]></column-value></column>");
305                    sb.append(
306                            "<column><column-name>type</column-name><column-value><![CDATA[");
307                    sb.append(getType());
308                    sb.append("]]></column-value></column>");
309                    sb.append(
310                            "<column><column-name>enabled</column-name><column-value><![CDATA[");
311                    sb.append(getEnabled());
312                    sb.append("]]></column-value></column>");
313    
314                    sb.append("</model>");
315    
316                    return sb.toString();
317            }
318    
319            private long _equityGroupSettingId;
320            private long _groupId;
321            private long _originalGroupId;
322            private boolean _setOriginalGroupId;
323            private long _companyId;
324            private long _classNameId;
325            private long _originalClassNameId;
326            private boolean _setOriginalClassNameId;
327            private int _type;
328            private int _originalType;
329            private boolean _setOriginalType;
330            private boolean _enabled;
331            private transient ExpandoBridge _expandoBridge;
332    }