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     * The base model implementation for the SocialEquityAssetEntry service. Represents a row in the "SocialEquityAssetEntry" database table, with each column mapped to a property of this class.
038     *
039     * <p>
040     * This implementation and its corresponding interface {@link com.liferay.portlet.social.model.SocialEquityAssetEntryModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link SocialEquityAssetEntryImpl}.
041     * </p>
042     *
043     * <p>
044     * Never modify or reference this class directly. All methods that expect a social equity asset entry model instance should use the {@link com.liferay.portlet.social.model.SocialEquityAssetEntry} interface instead.
045     * </p>
046     *
047     * @author Brian Wing Shun Chan
048     * @see SocialEquityAssetEntryImpl
049     * @see com.liferay.portlet.social.model.SocialEquityAssetEntry
050     * @see com.liferay.portlet.social.model.SocialEquityAssetEntryModel
051     * @generated
052     */
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                    _assetEntryId = assetEntryId;
140    
141                    if (!_setOriginalAssetEntryId) {
142                            _setOriginalAssetEntryId = true;
143    
144                            _originalAssetEntryId = assetEntryId;
145                    }
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 clone = new SocialEquityAssetEntryImpl();
194    
195                    clone.setEquityAssetEntryId(getEquityAssetEntryId());
196                    clone.setGroupId(getGroupId());
197                    clone.setCompanyId(getCompanyId());
198                    clone.setUserId(getUserId());
199                    clone.setAssetEntryId(getAssetEntryId());
200                    clone.setInformationK(getInformationK());
201                    clone.setInformationB(getInformationB());
202    
203                    return clone;
204            }
205    
206            public int compareTo(SocialEquityAssetEntry socialEquityAssetEntry) {
207                    long pk = socialEquityAssetEntry.getPrimaryKey();
208    
209                    if (getPrimaryKey() < pk) {
210                            return -1;
211                    }
212                    else if (getPrimaryKey() > pk) {
213                            return 1;
214                    }
215                    else {
216                            return 0;
217                    }
218            }
219    
220            public boolean equals(Object obj) {
221                    if (obj == null) {
222                            return false;
223                    }
224    
225                    SocialEquityAssetEntry socialEquityAssetEntry = null;
226    
227                    try {
228                            socialEquityAssetEntry = (SocialEquityAssetEntry)obj;
229                    }
230                    catch (ClassCastException cce) {
231                            return false;
232                    }
233    
234                    long pk = socialEquityAssetEntry.getPrimaryKey();
235    
236                    if (getPrimaryKey() == pk) {
237                            return true;
238                    }
239                    else {
240                            return false;
241                    }
242            }
243    
244            public int hashCode() {
245                    return (int)getPrimaryKey();
246            }
247    
248            public String toString() {
249                    StringBundler sb = new StringBundler(15);
250    
251                    sb.append("{equityAssetEntryId=");
252                    sb.append(getEquityAssetEntryId());
253                    sb.append(", groupId=");
254                    sb.append(getGroupId());
255                    sb.append(", companyId=");
256                    sb.append(getCompanyId());
257                    sb.append(", userId=");
258                    sb.append(getUserId());
259                    sb.append(", assetEntryId=");
260                    sb.append(getAssetEntryId());
261                    sb.append(", informationK=");
262                    sb.append(getInformationK());
263                    sb.append(", informationB=");
264                    sb.append(getInformationB());
265                    sb.append("}");
266    
267                    return sb.toString();
268            }
269    
270            public String toXmlString() {
271                    StringBundler sb = new StringBundler(25);
272    
273                    sb.append("<model><model-name>");
274                    sb.append("com.liferay.portlet.social.model.SocialEquityAssetEntry");
275                    sb.append("</model-name>");
276    
277                    sb.append(
278                            "<column><column-name>equityAssetEntryId</column-name><column-value><![CDATA[");
279                    sb.append(getEquityAssetEntryId());
280                    sb.append("]]></column-value></column>");
281                    sb.append(
282                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
283                    sb.append(getGroupId());
284                    sb.append("]]></column-value></column>");
285                    sb.append(
286                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
287                    sb.append(getCompanyId());
288                    sb.append("]]></column-value></column>");
289                    sb.append(
290                            "<column><column-name>userId</column-name><column-value><![CDATA[");
291                    sb.append(getUserId());
292                    sb.append("]]></column-value></column>");
293                    sb.append(
294                            "<column><column-name>assetEntryId</column-name><column-value><![CDATA[");
295                    sb.append(getAssetEntryId());
296                    sb.append("]]></column-value></column>");
297                    sb.append(
298                            "<column><column-name>informationK</column-name><column-value><![CDATA[");
299                    sb.append(getInformationK());
300                    sb.append("]]></column-value></column>");
301                    sb.append(
302                            "<column><column-name>informationB</column-name><column-value><![CDATA[");
303                    sb.append(getInformationB());
304                    sb.append("]]></column-value></column>");
305    
306                    sb.append("</model>");
307    
308                    return sb.toString();
309            }
310    
311            private long _equityAssetEntryId;
312            private long _groupId;
313            private long _companyId;
314            private long _userId;
315            private String _userUuid;
316            private long _assetEntryId;
317            private long _originalAssetEntryId;
318            private boolean _setOriginalAssetEntryId;
319            private double _informationK;
320            private double _informationB;
321            private transient ExpandoBridge _expandoBridge;
322    }