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.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.SocialEquityAssetEntry;
028 import com.liferay.portlet.social.model.SocialEquityAssetEntryModel;
029
030 import java.io.Serializable;
031
032 import java.lang.reflect.Proxy;
033
034 import java.sql.Types;
035
036
053 public class SocialEquityAssetEntryModelImpl extends BaseModelImpl<SocialEquityAssetEntry>
054 implements SocialEquityAssetEntryModel {
055 public static final String TABLE_NAME = "SocialEquityAssetEntry";
056 public static final Object[][] TABLE_COLUMNS = {
057 { "equityAssetEntryId", new Integer(Types.BIGINT) },
058 { "groupId", new Integer(Types.BIGINT) },
059 { "companyId", new Integer(Types.BIGINT) },
060 { "userId", new Integer(Types.BIGINT) },
061 { "assetEntryId", new Integer(Types.BIGINT) },
062 { "informationK", new Integer(Types.DOUBLE) },
063 { "informationB", new Integer(Types.DOUBLE) }
064 };
065 public static final String TABLE_SQL_CREATE = "create table SocialEquityAssetEntry (equityAssetEntryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,assetEntryId LONG,informationK DOUBLE,informationB DOUBLE)";
066 public static final String TABLE_SQL_DROP = "drop table SocialEquityAssetEntry";
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.SocialEquityAssetEntry"),
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.SocialEquityAssetEntry"),
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.SocialEquityAssetEntry"));
078
079 public SocialEquityAssetEntryModelImpl() {
080 }
081
082 public long getPrimaryKey() {
083 return _equityAssetEntryId;
084 }
085
086 public void setPrimaryKey(long pk) {
087 setEquityAssetEntryId(pk);
088 }
089
090 public Serializable getPrimaryKeyObj() {
091 return new Long(_equityAssetEntryId);
092 }
093
094 public long getEquityAssetEntryId() {
095 return _equityAssetEntryId;
096 }
097
098 public void setEquityAssetEntryId(long equityAssetEntryId) {
099 _equityAssetEntryId = equityAssetEntryId;
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
126 public String getUserUuid() throws SystemException {
127 return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
128 }
129
130 public void setUserUuid(String userUuid) {
131 _userUuid = userUuid;
132 }
133
134 public long getAssetEntryId() {
135 return _assetEntryId;
136 }
137
138 public void setAssetEntryId(long assetEntryId) {
139 if (!_setOriginalAssetEntryId) {
140 _setOriginalAssetEntryId = true;
141
142 _originalAssetEntryId = _assetEntryId;
143 }
144
145 _assetEntryId = assetEntryId;
146 }
147
148 public long getOriginalAssetEntryId() {
149 return _originalAssetEntryId;
150 }
151
152 public double getInformationK() {
153 return _informationK;
154 }
155
156 public void setInformationK(double informationK) {
157 _informationK = informationK;
158 }
159
160 public double getInformationB() {
161 return _informationB;
162 }
163
164 public void setInformationB(double informationB) {
165 _informationB = informationB;
166 }
167
168 public SocialEquityAssetEntry toEscapedModel() {
169 if (isEscapedModel()) {
170 return (SocialEquityAssetEntry)this;
171 }
172 else {
173 return (SocialEquityAssetEntry)Proxy.newProxyInstance(SocialEquityAssetEntry.class.getClassLoader(),
174 new Class[] { SocialEquityAssetEntry.class },
175 new AutoEscapeBeanHandler(this));
176 }
177 }
178
179 public ExpandoBridge getExpandoBridge() {
180 if (_expandoBridge == null) {
181 _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
182 SocialEquityAssetEntry.class.getName(), getPrimaryKey());
183 }
184
185 return _expandoBridge;
186 }
187
188 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
189 getExpandoBridge().setAttributes(serviceContext);
190 }
191
192 public Object clone() {
193 SocialEquityAssetEntryImpl socialEquityAssetEntryImpl = new SocialEquityAssetEntryImpl();
194
195 socialEquityAssetEntryImpl.setEquityAssetEntryId(getEquityAssetEntryId());
196
197 socialEquityAssetEntryImpl.setGroupId(getGroupId());
198
199 socialEquityAssetEntryImpl.setCompanyId(getCompanyId());
200
201 socialEquityAssetEntryImpl.setUserId(getUserId());
202
203 socialEquityAssetEntryImpl.setAssetEntryId(getAssetEntryId());
204
205 SocialEquityAssetEntryModelImpl socialEquityAssetEntryModelImpl = socialEquityAssetEntryImpl;
206
207 socialEquityAssetEntryModelImpl._originalAssetEntryId = socialEquityAssetEntryModelImpl._assetEntryId;
208
209 socialEquityAssetEntryModelImpl._setOriginalAssetEntryId = false;
210 socialEquityAssetEntryImpl.setInformationK(getInformationK());
211
212 socialEquityAssetEntryImpl.setInformationB(getInformationB());
213
214 return socialEquityAssetEntryImpl;
215 }
216
217 public int compareTo(SocialEquityAssetEntry socialEquityAssetEntry) {
218 long pk = socialEquityAssetEntry.getPrimaryKey();
219
220 if (getPrimaryKey() < pk) {
221 return -1;
222 }
223 else if (getPrimaryKey() > pk) {
224 return 1;
225 }
226 else {
227 return 0;
228 }
229 }
230
231 public boolean equals(Object obj) {
232 if (obj == null) {
233 return false;
234 }
235
236 SocialEquityAssetEntry socialEquityAssetEntry = null;
237
238 try {
239 socialEquityAssetEntry = (SocialEquityAssetEntry)obj;
240 }
241 catch (ClassCastException cce) {
242 return false;
243 }
244
245 long pk = socialEquityAssetEntry.getPrimaryKey();
246
247 if (getPrimaryKey() == pk) {
248 return true;
249 }
250 else {
251 return false;
252 }
253 }
254
255 public int hashCode() {
256 return (int)getPrimaryKey();
257 }
258
259 public String toString() {
260 StringBundler sb = new StringBundler(15);
261
262 sb.append("{equityAssetEntryId=");
263 sb.append(getEquityAssetEntryId());
264 sb.append(", groupId=");
265 sb.append(getGroupId());
266 sb.append(", companyId=");
267 sb.append(getCompanyId());
268 sb.append(", userId=");
269 sb.append(getUserId());
270 sb.append(", assetEntryId=");
271 sb.append(getAssetEntryId());
272 sb.append(", informationK=");
273 sb.append(getInformationK());
274 sb.append(", informationB=");
275 sb.append(getInformationB());
276 sb.append("}");
277
278 return sb.toString();
279 }
280
281 public String toXmlString() {
282 StringBundler sb = new StringBundler(25);
283
284 sb.append("<model><model-name>");
285 sb.append("com.liferay.portlet.social.model.SocialEquityAssetEntry");
286 sb.append("</model-name>");
287
288 sb.append(
289 "<column><column-name>equityAssetEntryId</column-name><column-value><![CDATA[");
290 sb.append(getEquityAssetEntryId());
291 sb.append("]]></column-value></column>");
292 sb.append(
293 "<column><column-name>groupId</column-name><column-value><![CDATA[");
294 sb.append(getGroupId());
295 sb.append("]]></column-value></column>");
296 sb.append(
297 "<column><column-name>companyId</column-name><column-value><![CDATA[");
298 sb.append(getCompanyId());
299 sb.append("]]></column-value></column>");
300 sb.append(
301 "<column><column-name>userId</column-name><column-value><![CDATA[");
302 sb.append(getUserId());
303 sb.append("]]></column-value></column>");
304 sb.append(
305 "<column><column-name>assetEntryId</column-name><column-value><![CDATA[");
306 sb.append(getAssetEntryId());
307 sb.append("]]></column-value></column>");
308 sb.append(
309 "<column><column-name>informationK</column-name><column-value><![CDATA[");
310 sb.append(getInformationK());
311 sb.append("]]></column-value></column>");
312 sb.append(
313 "<column><column-name>informationB</column-name><column-value><![CDATA[");
314 sb.append(getInformationB());
315 sb.append("]]></column-value></column>");
316
317 sb.append("</model>");
318
319 return sb.toString();
320 }
321
322 private long _equityAssetEntryId;
323 private long _groupId;
324 private long _companyId;
325 private long _userId;
326 private String _userUuid;
327 private long _assetEntryId;
328 private long _originalAssetEntryId;
329 private boolean _setOriginalAssetEntryId;
330 private double _informationK;
331 private double _informationB;
332 private transient ExpandoBridge _expandoBridge;
333 }