001
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
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 _userId = userId;
129
130 if (!_setOriginalUserId) {
131 _setOriginalUserId = true;
132
133 _originalUserId = userId;
134 }
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 _assetEntryId = assetEntryId;
155
156 if (!_setOriginalAssetEntryId) {
157 _setOriginalAssetEntryId = true;
158
159 _originalAssetEntryId = assetEntryId;
160 }
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 _actionId = actionId;
178
179 if (_originalActionId == null) {
180 _originalActionId = actionId;
181 }
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 _actionDate = actionDate;
194
195 if (!_setOriginalActionDate) {
196 _setOriginalActionDate = true;
197
198 _originalActionDate = actionDate;
199 }
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 _active = active;
216
217 if (!_setOriginalActive) {
218 _setOriginalActive = true;
219
220 _originalActive = active;
221 }
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 _type = type;
242
243 if (!_setOriginalType) {
244 _setOriginalType = true;
245
246 _originalType = type;
247 }
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 clone = new SocialEquityLogImpl();
288
289 clone.setEquityLogId(getEquityLogId());
290 clone.setGroupId(getGroupId());
291 clone.setCompanyId(getCompanyId());
292 clone.setUserId(getUserId());
293 clone.setAssetEntryId(getAssetEntryId());
294 clone.setActionId(getActionId());
295 clone.setActionDate(getActionDate());
296 clone.setActive(getActive());
297 clone.setExpiration(getExpiration());
298 clone.setType(getType());
299 clone.setValue(getValue());
300
301 return clone;
302 }
303
304 public int compareTo(SocialEquityLog socialEquityLog) {
305 long pk = socialEquityLog.getPrimaryKey();
306
307 if (getPrimaryKey() < pk) {
308 return -1;
309 }
310 else if (getPrimaryKey() > pk) {
311 return 1;
312 }
313 else {
314 return 0;
315 }
316 }
317
318 public boolean equals(Object obj) {
319 if (obj == null) {
320 return false;
321 }
322
323 SocialEquityLog socialEquityLog = null;
324
325 try {
326 socialEquityLog = (SocialEquityLog)obj;
327 }
328 catch (ClassCastException cce) {
329 return false;
330 }
331
332 long pk = socialEquityLog.getPrimaryKey();
333
334 if (getPrimaryKey() == pk) {
335 return true;
336 }
337 else {
338 return false;
339 }
340 }
341
342 public int hashCode() {
343 return (int)getPrimaryKey();
344 }
345
346 public String toString() {
347 StringBundler sb = new StringBundler(23);
348
349 sb.append("{equityLogId=");
350 sb.append(getEquityLogId());
351 sb.append(", groupId=");
352 sb.append(getGroupId());
353 sb.append(", companyId=");
354 sb.append(getCompanyId());
355 sb.append(", userId=");
356 sb.append(getUserId());
357 sb.append(", assetEntryId=");
358 sb.append(getAssetEntryId());
359 sb.append(", actionId=");
360 sb.append(getActionId());
361 sb.append(", actionDate=");
362 sb.append(getActionDate());
363 sb.append(", active=");
364 sb.append(getActive());
365 sb.append(", expiration=");
366 sb.append(getExpiration());
367 sb.append(", type=");
368 sb.append(getType());
369 sb.append(", value=");
370 sb.append(getValue());
371 sb.append("}");
372
373 return sb.toString();
374 }
375
376 public String toXmlString() {
377 StringBundler sb = new StringBundler(37);
378
379 sb.append("<model><model-name>");
380 sb.append("com.liferay.portlet.social.model.SocialEquityLog");
381 sb.append("</model-name>");
382
383 sb.append(
384 "<column><column-name>equityLogId</column-name><column-value><![CDATA[");
385 sb.append(getEquityLogId());
386 sb.append("]]></column-value></column>");
387 sb.append(
388 "<column><column-name>groupId</column-name><column-value><![CDATA[");
389 sb.append(getGroupId());
390 sb.append("]]></column-value></column>");
391 sb.append(
392 "<column><column-name>companyId</column-name><column-value><![CDATA[");
393 sb.append(getCompanyId());
394 sb.append("]]></column-value></column>");
395 sb.append(
396 "<column><column-name>userId</column-name><column-value><![CDATA[");
397 sb.append(getUserId());
398 sb.append("]]></column-value></column>");
399 sb.append(
400 "<column><column-name>assetEntryId</column-name><column-value><![CDATA[");
401 sb.append(getAssetEntryId());
402 sb.append("]]></column-value></column>");
403 sb.append(
404 "<column><column-name>actionId</column-name><column-value><![CDATA[");
405 sb.append(getActionId());
406 sb.append("]]></column-value></column>");
407 sb.append(
408 "<column><column-name>actionDate</column-name><column-value><![CDATA[");
409 sb.append(getActionDate());
410 sb.append("]]></column-value></column>");
411 sb.append(
412 "<column><column-name>active</column-name><column-value><![CDATA[");
413 sb.append(getActive());
414 sb.append("]]></column-value></column>");
415 sb.append(
416 "<column><column-name>expiration</column-name><column-value><![CDATA[");
417 sb.append(getExpiration());
418 sb.append("]]></column-value></column>");
419 sb.append(
420 "<column><column-name>type</column-name><column-value><![CDATA[");
421 sb.append(getType());
422 sb.append("]]></column-value></column>");
423 sb.append(
424 "<column><column-name>value</column-name><column-value><![CDATA[");
425 sb.append(getValue());
426 sb.append("]]></column-value></column>");
427
428 sb.append("</model>");
429
430 return sb.toString();
431 }
432
433 private long _equityLogId;
434 private long _groupId;
435 private long _companyId;
436 private long _userId;
437 private String _userUuid;
438 private long _originalUserId;
439 private boolean _setOriginalUserId;
440 private long _assetEntryId;
441 private long _originalAssetEntryId;
442 private boolean _setOriginalAssetEntryId;
443 private String _actionId;
444 private String _originalActionId;
445 private int _actionDate;
446 private int _originalActionDate;
447 private boolean _setOriginalActionDate;
448 private boolean _active;
449 private boolean _originalActive;
450 private boolean _setOriginalActive;
451 private int _expiration;
452 private int _type;
453 private int _originalType;
454 private boolean _setOriginalType;
455 private int _value;
456 private transient ExpandoBridge _expandoBridge;
457 }