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.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    /**
037     * <p>
038     * This interface is a model that represents the SocialEquityAssetEntry table in the
039     * database.
040     * </p>
041     *
042     * @author    Brian Wing Shun Chan
043     * @see       SocialEquityAssetEntryImpl
044     * @see       com.liferay.portlet.social.model.SocialEquityAssetEntry
045     * @see       com.liferay.portlet.social.model.SocialEquityAssetEntryModel
046     * @generated
047     */
048    public class SocialEquityAssetEntryModelImpl extends BaseModelImpl<SocialEquityAssetEntry>
049            implements SocialEquityAssetEntryModel {
050            public static final String TABLE_NAME = "SocialEquityAssetEntry";
051            public static final Object[][] TABLE_COLUMNS = {
052                            { "equityAssetEntryId", new Integer(Types.BIGINT) },
053                            { "groupId", new Integer(Types.BIGINT) },
054                            { "companyId", new Integer(Types.BIGINT) },
055                            { "userId", new Integer(Types.BIGINT) },
056                            { "assetEntryId", new Integer(Types.BIGINT) },
057                            { "informationK", new Integer(Types.DOUBLE) },
058                            { "informationB", new Integer(Types.DOUBLE) }
059                    };
060            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)";
061            public static final String TABLE_SQL_DROP = "drop table SocialEquityAssetEntry";
062            public static final String DATA_SOURCE = "liferayDataSource";
063            public static final String SESSION_FACTORY = "liferaySessionFactory";
064            public static final String TX_MANAGER = "liferayTransactionManager";
065            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
066                                    "value.object.entity.cache.enabled.com.liferay.portlet.social.model.SocialEquityAssetEntry"),
067                            true);
068            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
069                                    "value.object.finder.cache.enabled.com.liferay.portlet.social.model.SocialEquityAssetEntry"),
070                            true);
071            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
072                                    "lock.expiration.time.com.liferay.portlet.social.model.SocialEquityAssetEntry"));
073    
074            public SocialEquityAssetEntryModelImpl() {
075            }
076    
077            public long getPrimaryKey() {
078                    return _equityAssetEntryId;
079            }
080    
081            public void setPrimaryKey(long pk) {
082                    setEquityAssetEntryId(pk);
083            }
084    
085            public Serializable getPrimaryKeyObj() {
086                    return new Long(_equityAssetEntryId);
087            }
088    
089            public long getEquityAssetEntryId() {
090                    return _equityAssetEntryId;
091            }
092    
093            public void setEquityAssetEntryId(long equityAssetEntryId) {
094                    _equityAssetEntryId = equityAssetEntryId;
095            }
096    
097            public long getGroupId() {
098                    return _groupId;
099            }
100    
101            public void setGroupId(long groupId) {
102                    _groupId = groupId;
103            }
104    
105            public long getCompanyId() {
106                    return _companyId;
107            }
108    
109            public void setCompanyId(long companyId) {
110                    _companyId = companyId;
111            }
112    
113            public long getUserId() {
114                    return _userId;
115            }
116    
117            public void setUserId(long userId) {
118                    _userId = userId;
119            }
120    
121            public String getUserUuid() throws SystemException {
122                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
123            }
124    
125            public void setUserUuid(String userUuid) {
126                    _userUuid = userUuid;
127            }
128    
129            public long getAssetEntryId() {
130                    return _assetEntryId;
131            }
132    
133            public void setAssetEntryId(long assetEntryId) {
134                    _assetEntryId = assetEntryId;
135    
136                    if (!_setOriginalAssetEntryId) {
137                            _setOriginalAssetEntryId = true;
138    
139                            _originalAssetEntryId = assetEntryId;
140                    }
141            }
142    
143            public long getOriginalAssetEntryId() {
144                    return _originalAssetEntryId;
145            }
146    
147            public double getInformationK() {
148                    return _informationK;
149            }
150    
151            public void setInformationK(double informationK) {
152                    _informationK = informationK;
153            }
154    
155            public double getInformationB() {
156                    return _informationB;
157            }
158    
159            public void setInformationB(double informationB) {
160                    _informationB = informationB;
161            }
162    
163            public SocialEquityAssetEntry toEscapedModel() {
164                    if (isEscapedModel()) {
165                            return (SocialEquityAssetEntry)this;
166                    }
167                    else {
168                            return (SocialEquityAssetEntry)Proxy.newProxyInstance(SocialEquityAssetEntry.class.getClassLoader(),
169                                    new Class[] { SocialEquityAssetEntry.class },
170                                    new AutoEscapeBeanHandler(this));
171                    }
172            }
173    
174            public ExpandoBridge getExpandoBridge() {
175                    if (_expandoBridge == null) {
176                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
177                                            SocialEquityAssetEntry.class.getName(), getPrimaryKey());
178                    }
179    
180                    return _expandoBridge;
181            }
182    
183            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
184                    getExpandoBridge().setAttributes(serviceContext);
185            }
186    
187            public Object clone() {
188                    SocialEquityAssetEntryImpl clone = new SocialEquityAssetEntryImpl();
189    
190                    clone.setEquityAssetEntryId(getEquityAssetEntryId());
191                    clone.setGroupId(getGroupId());
192                    clone.setCompanyId(getCompanyId());
193                    clone.setUserId(getUserId());
194                    clone.setAssetEntryId(getAssetEntryId());
195                    clone.setInformationK(getInformationK());
196                    clone.setInformationB(getInformationB());
197    
198                    return clone;
199            }
200    
201            public int compareTo(SocialEquityAssetEntry socialEquityAssetEntry) {
202                    long pk = socialEquityAssetEntry.getPrimaryKey();
203    
204                    if (getPrimaryKey() < pk) {
205                            return -1;
206                    }
207                    else if (getPrimaryKey() > pk) {
208                            return 1;
209                    }
210                    else {
211                            return 0;
212                    }
213            }
214    
215            public boolean equals(Object obj) {
216                    if (obj == null) {
217                            return false;
218                    }
219    
220                    SocialEquityAssetEntry socialEquityAssetEntry = null;
221    
222                    try {
223                            socialEquityAssetEntry = (SocialEquityAssetEntry)obj;
224                    }
225                    catch (ClassCastException cce) {
226                            return false;
227                    }
228    
229                    long pk = socialEquityAssetEntry.getPrimaryKey();
230    
231                    if (getPrimaryKey() == pk) {
232                            return true;
233                    }
234                    else {
235                            return false;
236                    }
237            }
238    
239            public int hashCode() {
240                    return (int)getPrimaryKey();
241            }
242    
243            public String toString() {
244                    StringBundler sb = new StringBundler(15);
245    
246                    sb.append("{equityAssetEntryId=");
247                    sb.append(getEquityAssetEntryId());
248                    sb.append(", groupId=");
249                    sb.append(getGroupId());
250                    sb.append(", companyId=");
251                    sb.append(getCompanyId());
252                    sb.append(", userId=");
253                    sb.append(getUserId());
254                    sb.append(", assetEntryId=");
255                    sb.append(getAssetEntryId());
256                    sb.append(", informationK=");
257                    sb.append(getInformationK());
258                    sb.append(", informationB=");
259                    sb.append(getInformationB());
260                    sb.append("}");
261    
262                    return sb.toString();
263            }
264    
265            public String toXmlString() {
266                    StringBundler sb = new StringBundler(25);
267    
268                    sb.append("<model><model-name>");
269                    sb.append("com.liferay.portlet.social.model.SocialEquityAssetEntry");
270                    sb.append("</model-name>");
271    
272                    sb.append(
273                            "<column><column-name>equityAssetEntryId</column-name><column-value><![CDATA[");
274                    sb.append(getEquityAssetEntryId());
275                    sb.append("]]></column-value></column>");
276                    sb.append(
277                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
278                    sb.append(getGroupId());
279                    sb.append("]]></column-value></column>");
280                    sb.append(
281                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
282                    sb.append(getCompanyId());
283                    sb.append("]]></column-value></column>");
284                    sb.append(
285                            "<column><column-name>userId</column-name><column-value><![CDATA[");
286                    sb.append(getUserId());
287                    sb.append("]]></column-value></column>");
288                    sb.append(
289                            "<column><column-name>assetEntryId</column-name><column-value><![CDATA[");
290                    sb.append(getAssetEntryId());
291                    sb.append("]]></column-value></column>");
292                    sb.append(
293                            "<column><column-name>informationK</column-name><column-value><![CDATA[");
294                    sb.append(getInformationK());
295                    sb.append("]]></column-value></column>");
296                    sb.append(
297                            "<column><column-name>informationB</column-name><column-value><![CDATA[");
298                    sb.append(getInformationB());
299                    sb.append("]]></column-value></column>");
300    
301                    sb.append("</model>");
302    
303                    return sb.toString();
304            }
305    
306            private long _equityAssetEntryId;
307            private long _groupId;
308            private long _companyId;
309            private long _userId;
310            private String _userUuid;
311            private long _assetEntryId;
312            private long _originalAssetEntryId;
313            private boolean _setOriginalAssetEntryId;
314            private double _informationK;
315            private double _informationB;
316            private transient ExpandoBridge _expandoBridge;
317    }