001    /**
002     * Copyright (c) 2000-2011 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.social.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.util.GetterUtil;
020    import com.liferay.portal.kernel.util.StringBundler;
021    import com.liferay.portal.kernel.util.StringPool;
022    import com.liferay.portal.model.impl.BaseModelImpl;
023    import com.liferay.portal.service.ServiceContext;
024    import com.liferay.portal.util.PortalUtil;
025    
026    import com.liferay.portlet.expando.model.ExpandoBridge;
027    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
028    import com.liferay.portlet.social.model.SocialEquityLog;
029    import com.liferay.portlet.social.model.SocialEquityLogModel;
030    
031    import java.io.Serializable;
032    
033    import java.lang.reflect.Proxy;
034    
035    import java.sql.Types;
036    
037    /**
038     * The base model implementation for the SocialEquityLog service. Represents a row in the "SocialEquityLog" database table, with each column mapped to a property of this class.
039     *
040     * <p>
041     * This implementation and its corresponding interface {@link com.liferay.portlet.social.model.SocialEquityLogModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link SocialEquityLogImpl}.
042     * </p>
043     *
044     * <p>
045     * Never modify or reference this class directly. All methods that expect a social equity log model instance should use the {@link com.liferay.portlet.social.model.SocialEquityLog} interface instead.
046     * </p>
047     *
048     * @author Brian Wing Shun Chan
049     * @see SocialEquityLogImpl
050     * @see com.liferay.portlet.social.model.SocialEquityLog
051     * @see com.liferay.portlet.social.model.SocialEquityLogModel
052     * @generated
053     */
054    public class SocialEquityLogModelImpl extends BaseModelImpl<SocialEquityLog>
055            implements SocialEquityLogModel {
056            public static final String TABLE_NAME = "SocialEquityLog";
057            public static final Object[][] TABLE_COLUMNS = {
058                            { "equityLogId", new Integer(Types.BIGINT) },
059                            { "groupId", new Integer(Types.BIGINT) },
060                            { "companyId", new Integer(Types.BIGINT) },
061                            { "userId", new Integer(Types.BIGINT) },
062                            { "assetEntryId", new Integer(Types.BIGINT) },
063                            { "actionId", new Integer(Types.VARCHAR) },
064                            { "actionDate", new Integer(Types.INTEGER) },
065                            { "active_", new Integer(Types.BOOLEAN) },
066                            { "expiration", new Integer(Types.INTEGER) },
067                            { "type_", new Integer(Types.INTEGER) },
068                            { "value", new Integer(Types.INTEGER) }
069                    };
070            public static final String TABLE_SQL_CREATE = "create table SocialEquityLog (equityLogId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,assetEntryId LONG,actionId VARCHAR(75) null,actionDate INTEGER,active_ BOOLEAN,expiration INTEGER,type_ INTEGER,value INTEGER)";
071            public static final String TABLE_SQL_DROP = "drop table SocialEquityLog";
072            public static final String DATA_SOURCE = "liferayDataSource";
073            public static final String SESSION_FACTORY = "liferaySessionFactory";
074            public static final String TX_MANAGER = "liferayTransactionManager";
075            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
076                                    "value.object.entity.cache.enabled.com.liferay.portlet.social.model.SocialEquityLog"),
077                            true);
078            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
079                                    "value.object.finder.cache.enabled.com.liferay.portlet.social.model.SocialEquityLog"),
080                            true);
081            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
082                                    "lock.expiration.time.com.liferay.portlet.social.model.SocialEquityLog"));
083    
084            public SocialEquityLogModelImpl() {
085            }
086    
087            public long getPrimaryKey() {
088                    return _equityLogId;
089            }
090    
091            public void setPrimaryKey(long pk) {
092                    setEquityLogId(pk);
093            }
094    
095            public Serializable getPrimaryKeyObj() {
096                    return new Long(_equityLogId);
097            }
098    
099            public long getEquityLogId() {
100                    return _equityLogId;
101            }
102    
103            public void setEquityLogId(long equityLogId) {
104                    _equityLogId = equityLogId;
105            }
106    
107            public long getGroupId() {
108                    return _groupId;
109            }
110    
111            public void setGroupId(long groupId) {
112                    _groupId = groupId;
113            }
114    
115            public long getCompanyId() {
116                    return _companyId;
117            }
118    
119            public void setCompanyId(long companyId) {
120                    _companyId = companyId;
121            }
122    
123            public long getUserId() {
124                    return _userId;
125            }
126    
127            public void setUserId(long userId) {
128                    if (!_setOriginalUserId) {
129                            _setOriginalUserId = true;
130    
131                            _originalUserId = _userId;
132                    }
133    
134                    _userId = userId;
135            }
136    
137            public String getUserUuid() throws SystemException {
138                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
139            }
140    
141            public void setUserUuid(String userUuid) {
142                    _userUuid = userUuid;
143            }
144    
145            public long getOriginalUserId() {
146                    return _originalUserId;
147            }
148    
149            public long getAssetEntryId() {
150                    return _assetEntryId;
151            }
152    
153            public void setAssetEntryId(long assetEntryId) {
154                    if (!_setOriginalAssetEntryId) {
155                            _setOriginalAssetEntryId = true;
156    
157                            _originalAssetEntryId = _assetEntryId;
158                    }
159    
160                    _assetEntryId = assetEntryId;
161            }
162    
163            public long getOriginalAssetEntryId() {
164                    return _originalAssetEntryId;
165            }
166    
167            public String getActionId() {
168                    if (_actionId == null) {
169                            return StringPool.BLANK;
170                    }
171                    else {
172                            return _actionId;
173                    }
174            }
175    
176            public void setActionId(String actionId) {
177                    if (_originalActionId == null) {
178                            _originalActionId = _actionId;
179                    }
180    
181                    _actionId = actionId;
182            }
183    
184            public String getOriginalActionId() {
185                    return GetterUtil.getString(_originalActionId);
186            }
187    
188            public int getActionDate() {
189                    return _actionDate;
190            }
191    
192            public void setActionDate(int actionDate) {
193                    if (!_setOriginalActionDate) {
194                            _setOriginalActionDate = true;
195    
196                            _originalActionDate = _actionDate;
197                    }
198    
199                    _actionDate = actionDate;
200            }
201    
202            public int getOriginalActionDate() {
203                    return _originalActionDate;
204            }
205    
206            public boolean getActive() {
207                    return _active;
208            }
209    
210            public boolean isActive() {
211                    return _active;
212            }
213    
214            public void setActive(boolean active) {
215                    if (!_setOriginalActive) {
216                            _setOriginalActive = true;
217    
218                            _originalActive = _active;
219                    }
220    
221                    _active = active;
222            }
223    
224            public boolean getOriginalActive() {
225                    return _originalActive;
226            }
227    
228            public int getExpiration() {
229                    return _expiration;
230            }
231    
232            public void setExpiration(int expiration) {
233                    _expiration = expiration;
234            }
235    
236            public int getType() {
237                    return _type;
238            }
239    
240            public void setType(int type) {
241                    if (!_setOriginalType) {
242                            _setOriginalType = true;
243    
244                            _originalType = _type;
245                    }
246    
247                    _type = type;
248            }
249    
250            public int getOriginalType() {
251                    return _originalType;
252            }
253    
254            public int getValue() {
255                    return _value;
256            }
257    
258            public void setValue(int value) {
259                    _value = value;
260            }
261    
262            public SocialEquityLog toEscapedModel() {
263                    if (isEscapedModel()) {
264                            return (SocialEquityLog)this;
265                    }
266                    else {
267                            return (SocialEquityLog)Proxy.newProxyInstance(SocialEquityLog.class.getClassLoader(),
268                                    new Class[] { SocialEquityLog.class },
269                                    new AutoEscapeBeanHandler(this));
270                    }
271            }
272    
273            public ExpandoBridge getExpandoBridge() {
274                    if (_expandoBridge == null) {
275                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
276                                            SocialEquityLog.class.getName(), getPrimaryKey());
277                    }
278    
279                    return _expandoBridge;
280            }
281    
282            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
283                    getExpandoBridge().setAttributes(serviceContext);
284            }
285    
286            public Object clone() {
287                    SocialEquityLogImpl socialEquityLogImpl = new SocialEquityLogImpl();
288    
289                    socialEquityLogImpl.setEquityLogId(getEquityLogId());
290    
291                    socialEquityLogImpl.setGroupId(getGroupId());
292    
293                    socialEquityLogImpl.setCompanyId(getCompanyId());
294    
295                    socialEquityLogImpl.setUserId(getUserId());
296    
297                    SocialEquityLogModelImpl socialEquityLogModelImpl = socialEquityLogImpl;
298    
299                    socialEquityLogModelImpl._originalUserId = socialEquityLogModelImpl._userId;
300    
301                    socialEquityLogModelImpl._setOriginalUserId = false;
302                    socialEquityLogImpl.setAssetEntryId(getAssetEntryId());
303    
304                    socialEquityLogModelImpl._originalAssetEntryId = socialEquityLogModelImpl._assetEntryId;
305    
306                    socialEquityLogModelImpl._setOriginalAssetEntryId = false;
307                    socialEquityLogImpl.setActionId(getActionId());
308    
309                    socialEquityLogModelImpl._originalActionId = socialEquityLogModelImpl._actionId;
310    
311                    socialEquityLogImpl.setActionDate(getActionDate());
312    
313                    socialEquityLogModelImpl._originalActionDate = socialEquityLogModelImpl._actionDate;
314    
315                    socialEquityLogModelImpl._setOriginalActionDate = false;
316                    socialEquityLogImpl.setActive(getActive());
317    
318                    socialEquityLogModelImpl._originalActive = socialEquityLogModelImpl._active;
319    
320                    socialEquityLogModelImpl._setOriginalActive = false;
321                    socialEquityLogImpl.setExpiration(getExpiration());
322    
323                    socialEquityLogImpl.setType(getType());
324    
325                    socialEquityLogModelImpl._originalType = socialEquityLogModelImpl._type;
326    
327                    socialEquityLogModelImpl._setOriginalType = false;
328                    socialEquityLogImpl.setValue(getValue());
329    
330                    return socialEquityLogImpl;
331            }
332    
333            public int compareTo(SocialEquityLog socialEquityLog) {
334                    long pk = socialEquityLog.getPrimaryKey();
335    
336                    if (getPrimaryKey() < pk) {
337                            return -1;
338                    }
339                    else if (getPrimaryKey() > pk) {
340                            return 1;
341                    }
342                    else {
343                            return 0;
344                    }
345            }
346    
347            public boolean equals(Object obj) {
348                    if (obj == null) {
349                            return false;
350                    }
351    
352                    SocialEquityLog socialEquityLog = null;
353    
354                    try {
355                            socialEquityLog = (SocialEquityLog)obj;
356                    }
357                    catch (ClassCastException cce) {
358                            return false;
359                    }
360    
361                    long pk = socialEquityLog.getPrimaryKey();
362    
363                    if (getPrimaryKey() == pk) {
364                            return true;
365                    }
366                    else {
367                            return false;
368                    }
369            }
370    
371            public int hashCode() {
372                    return (int)getPrimaryKey();
373            }
374    
375            public String toString() {
376                    StringBundler sb = new StringBundler(23);
377    
378                    sb.append("{equityLogId=");
379                    sb.append(getEquityLogId());
380                    sb.append(", groupId=");
381                    sb.append(getGroupId());
382                    sb.append(", companyId=");
383                    sb.append(getCompanyId());
384                    sb.append(", userId=");
385                    sb.append(getUserId());
386                    sb.append(", assetEntryId=");
387                    sb.append(getAssetEntryId());
388                    sb.append(", actionId=");
389                    sb.append(getActionId());
390                    sb.append(", actionDate=");
391                    sb.append(getActionDate());
392                    sb.append(", active=");
393                    sb.append(getActive());
394                    sb.append(", expiration=");
395                    sb.append(getExpiration());
396                    sb.append(", type=");
397                    sb.append(getType());
398                    sb.append(", value=");
399                    sb.append(getValue());
400                    sb.append("}");
401    
402                    return sb.toString();
403            }
404    
405            public String toXmlString() {
406                    StringBundler sb = new StringBundler(37);
407    
408                    sb.append("<model><model-name>");
409                    sb.append("com.liferay.portlet.social.model.SocialEquityLog");
410                    sb.append("</model-name>");
411    
412                    sb.append(
413                            "<column><column-name>equityLogId</column-name><column-value><![CDATA[");
414                    sb.append(getEquityLogId());
415                    sb.append("]]></column-value></column>");
416                    sb.append(
417                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
418                    sb.append(getGroupId());
419                    sb.append("]]></column-value></column>");
420                    sb.append(
421                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
422                    sb.append(getCompanyId());
423                    sb.append("]]></column-value></column>");
424                    sb.append(
425                            "<column><column-name>userId</column-name><column-value><![CDATA[");
426                    sb.append(getUserId());
427                    sb.append("]]></column-value></column>");
428                    sb.append(
429                            "<column><column-name>assetEntryId</column-name><column-value><![CDATA[");
430                    sb.append(getAssetEntryId());
431                    sb.append("]]></column-value></column>");
432                    sb.append(
433                            "<column><column-name>actionId</column-name><column-value><![CDATA[");
434                    sb.append(getActionId());
435                    sb.append("]]></column-value></column>");
436                    sb.append(
437                            "<column><column-name>actionDate</column-name><column-value><![CDATA[");
438                    sb.append(getActionDate());
439                    sb.append("]]></column-value></column>");
440                    sb.append(
441                            "<column><column-name>active</column-name><column-value><![CDATA[");
442                    sb.append(getActive());
443                    sb.append("]]></column-value></column>");
444                    sb.append(
445                            "<column><column-name>expiration</column-name><column-value><![CDATA[");
446                    sb.append(getExpiration());
447                    sb.append("]]></column-value></column>");
448                    sb.append(
449                            "<column><column-name>type</column-name><column-value><![CDATA[");
450                    sb.append(getType());
451                    sb.append("]]></column-value></column>");
452                    sb.append(
453                            "<column><column-name>value</column-name><column-value><![CDATA[");
454                    sb.append(getValue());
455                    sb.append("]]></column-value></column>");
456    
457                    sb.append("</model>");
458    
459                    return sb.toString();
460            }
461    
462            private long _equityLogId;
463            private long _groupId;
464            private long _companyId;
465            private long _userId;
466            private String _userUuid;
467            private long _originalUserId;
468            private boolean _setOriginalUserId;
469            private long _assetEntryId;
470            private long _originalAssetEntryId;
471            private boolean _setOriginalAssetEntryId;
472            private String _actionId;
473            private String _originalActionId;
474            private int _actionDate;
475            private int _originalActionDate;
476            private boolean _setOriginalActionDate;
477            private boolean _active;
478            private boolean _originalActive;
479            private boolean _setOriginalActive;
480            private int _expiration;
481            private int _type;
482            private int _originalType;
483            private boolean _setOriginalType;
484            private int _value;
485            private transient ExpandoBridge _expandoBridge;
486    }