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