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.journal.model.impl;
016    
017    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018    import com.liferay.portal.kernel.util.GetterUtil;
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.kernel.util.StringPool;
021    import com.liferay.portal.model.impl.BaseModelImpl;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import com.liferay.portlet.expando.model.ExpandoBridge;
025    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
026    import com.liferay.portlet.journal.model.JournalContentSearch;
027    import com.liferay.portlet.journal.model.JournalContentSearchModel;
028    
029    import java.io.Serializable;
030    
031    import java.lang.reflect.Proxy;
032    
033    import java.sql.Types;
034    
035    /**
036     * The base model implementation for the JournalContentSearch service. Represents a row in the "JournalContentSearch" database table, with each column mapped to a property of this class.
037     *
038     * <p>
039     * This implementation and its corresponding interface {@link com.liferay.portlet.journal.model.JournalContentSearchModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link JournalContentSearchImpl}.
040     * </p>
041     *
042     * <p>
043     * Never modify or reference this class directly. All methods that expect a journal content search model instance should use the {@link com.liferay.portlet.journal.model.JournalContentSearch} interface instead.
044     * </p>
045     *
046     * @author Brian Wing Shun Chan
047     * @see JournalContentSearchImpl
048     * @see com.liferay.portlet.journal.model.JournalContentSearch
049     * @see com.liferay.portlet.journal.model.JournalContentSearchModel
050     * @generated
051     */
052    public class JournalContentSearchModelImpl extends BaseModelImpl<JournalContentSearch>
053            implements JournalContentSearchModel {
054            public static final String TABLE_NAME = "JournalContentSearch";
055            public static final Object[][] TABLE_COLUMNS = {
056                            { "contentSearchId", new Integer(Types.BIGINT) },
057                            { "groupId", new Integer(Types.BIGINT) },
058                            { "companyId", new Integer(Types.BIGINT) },
059                            { "privateLayout", new Integer(Types.BOOLEAN) },
060                            { "layoutId", new Integer(Types.BIGINT) },
061                            { "portletId", new Integer(Types.VARCHAR) },
062                            { "articleId", new Integer(Types.VARCHAR) }
063                    };
064            public static final String TABLE_SQL_CREATE = "create table JournalContentSearch (contentSearchId LONG not null primary key,groupId LONG,companyId LONG,privateLayout BOOLEAN,layoutId LONG,portletId VARCHAR(200) null,articleId VARCHAR(75) null)";
065            public static final String TABLE_SQL_DROP = "drop table JournalContentSearch";
066            public static final String DATA_SOURCE = "liferayDataSource";
067            public static final String SESSION_FACTORY = "liferaySessionFactory";
068            public static final String TX_MANAGER = "liferayTransactionManager";
069            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
070                                    "value.object.entity.cache.enabled.com.liferay.portlet.journal.model.JournalContentSearch"),
071                            true);
072            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
073                                    "value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalContentSearch"),
074                            true);
075            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
076                                    "lock.expiration.time.com.liferay.portlet.journal.model.JournalContentSearch"));
077    
078            public JournalContentSearchModelImpl() {
079            }
080    
081            public long getPrimaryKey() {
082                    return _contentSearchId;
083            }
084    
085            public void setPrimaryKey(long pk) {
086                    setContentSearchId(pk);
087            }
088    
089            public Serializable getPrimaryKeyObj() {
090                    return new Long(_contentSearchId);
091            }
092    
093            public long getContentSearchId() {
094                    return _contentSearchId;
095            }
096    
097            public void setContentSearchId(long contentSearchId) {
098                    _contentSearchId = contentSearchId;
099            }
100    
101            public long getGroupId() {
102                    return _groupId;
103            }
104    
105            public void setGroupId(long groupId) {
106                    _groupId = groupId;
107    
108                    if (!_setOriginalGroupId) {
109                            _setOriginalGroupId = true;
110    
111                            _originalGroupId = groupId;
112                    }
113            }
114    
115            public long getOriginalGroupId() {
116                    return _originalGroupId;
117            }
118    
119            public long getCompanyId() {
120                    return _companyId;
121            }
122    
123            public void setCompanyId(long companyId) {
124                    _companyId = companyId;
125            }
126    
127            public boolean getPrivateLayout() {
128                    return _privateLayout;
129            }
130    
131            public boolean isPrivateLayout() {
132                    return _privateLayout;
133            }
134    
135            public void setPrivateLayout(boolean privateLayout) {
136                    _privateLayout = privateLayout;
137    
138                    if (!_setOriginalPrivateLayout) {
139                            _setOriginalPrivateLayout = true;
140    
141                            _originalPrivateLayout = privateLayout;
142                    }
143            }
144    
145            public boolean getOriginalPrivateLayout() {
146                    return _originalPrivateLayout;
147            }
148    
149            public long getLayoutId() {
150                    return _layoutId;
151            }
152    
153            public void setLayoutId(long layoutId) {
154                    _layoutId = layoutId;
155    
156                    if (!_setOriginalLayoutId) {
157                            _setOriginalLayoutId = true;
158    
159                            _originalLayoutId = layoutId;
160                    }
161            }
162    
163            public long getOriginalLayoutId() {
164                    return _originalLayoutId;
165            }
166    
167            public String getPortletId() {
168                    if (_portletId == null) {
169                            return StringPool.BLANK;
170                    }
171                    else {
172                            return _portletId;
173                    }
174            }
175    
176            public void setPortletId(String portletId) {
177                    _portletId = portletId;
178    
179                    if (_originalPortletId == null) {
180                            _originalPortletId = portletId;
181                    }
182            }
183    
184            public String getOriginalPortletId() {
185                    return GetterUtil.getString(_originalPortletId);
186            }
187    
188            public String getArticleId() {
189                    if (_articleId == null) {
190                            return StringPool.BLANK;
191                    }
192                    else {
193                            return _articleId;
194                    }
195            }
196    
197            public void setArticleId(String articleId) {
198                    _articleId = articleId;
199    
200                    if (_originalArticleId == null) {
201                            _originalArticleId = articleId;
202                    }
203            }
204    
205            public String getOriginalArticleId() {
206                    return GetterUtil.getString(_originalArticleId);
207            }
208    
209            public JournalContentSearch toEscapedModel() {
210                    if (isEscapedModel()) {
211                            return (JournalContentSearch)this;
212                    }
213                    else {
214                            return (JournalContentSearch)Proxy.newProxyInstance(JournalContentSearch.class.getClassLoader(),
215                                    new Class[] { JournalContentSearch.class },
216                                    new AutoEscapeBeanHandler(this));
217                    }
218            }
219    
220            public ExpandoBridge getExpandoBridge() {
221                    if (_expandoBridge == null) {
222                            _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
223                                            JournalContentSearch.class.getName(), getPrimaryKey());
224                    }
225    
226                    return _expandoBridge;
227            }
228    
229            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
230                    getExpandoBridge().setAttributes(serviceContext);
231            }
232    
233            public Object clone() {
234                    JournalContentSearchImpl clone = new JournalContentSearchImpl();
235    
236                    clone.setContentSearchId(getContentSearchId());
237                    clone.setGroupId(getGroupId());
238                    clone.setCompanyId(getCompanyId());
239                    clone.setPrivateLayout(getPrivateLayout());
240                    clone.setLayoutId(getLayoutId());
241                    clone.setPortletId(getPortletId());
242                    clone.setArticleId(getArticleId());
243    
244                    return clone;
245            }
246    
247            public int compareTo(JournalContentSearch journalContentSearch) {
248                    long pk = journalContentSearch.getPrimaryKey();
249    
250                    if (getPrimaryKey() < pk) {
251                            return -1;
252                    }
253                    else if (getPrimaryKey() > pk) {
254                            return 1;
255                    }
256                    else {
257                            return 0;
258                    }
259            }
260    
261            public boolean equals(Object obj) {
262                    if (obj == null) {
263                            return false;
264                    }
265    
266                    JournalContentSearch journalContentSearch = null;
267    
268                    try {
269                            journalContentSearch = (JournalContentSearch)obj;
270                    }
271                    catch (ClassCastException cce) {
272                            return false;
273                    }
274    
275                    long pk = journalContentSearch.getPrimaryKey();
276    
277                    if (getPrimaryKey() == pk) {
278                            return true;
279                    }
280                    else {
281                            return false;
282                    }
283            }
284    
285            public int hashCode() {
286                    return (int)getPrimaryKey();
287            }
288    
289            public String toString() {
290                    StringBundler sb = new StringBundler(15);
291    
292                    sb.append("{contentSearchId=");
293                    sb.append(getContentSearchId());
294                    sb.append(", groupId=");
295                    sb.append(getGroupId());
296                    sb.append(", companyId=");
297                    sb.append(getCompanyId());
298                    sb.append(", privateLayout=");
299                    sb.append(getPrivateLayout());
300                    sb.append(", layoutId=");
301                    sb.append(getLayoutId());
302                    sb.append(", portletId=");
303                    sb.append(getPortletId());
304                    sb.append(", articleId=");
305                    sb.append(getArticleId());
306                    sb.append("}");
307    
308                    return sb.toString();
309            }
310    
311            public String toXmlString() {
312                    StringBundler sb = new StringBundler(25);
313    
314                    sb.append("<model><model-name>");
315                    sb.append("com.liferay.portlet.journal.model.JournalContentSearch");
316                    sb.append("</model-name>");
317    
318                    sb.append(
319                            "<column><column-name>contentSearchId</column-name><column-value><![CDATA[");
320                    sb.append(getContentSearchId());
321                    sb.append("]]></column-value></column>");
322                    sb.append(
323                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
324                    sb.append(getGroupId());
325                    sb.append("]]></column-value></column>");
326                    sb.append(
327                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
328                    sb.append(getCompanyId());
329                    sb.append("]]></column-value></column>");
330                    sb.append(
331                            "<column><column-name>privateLayout</column-name><column-value><![CDATA[");
332                    sb.append(getPrivateLayout());
333                    sb.append("]]></column-value></column>");
334                    sb.append(
335                            "<column><column-name>layoutId</column-name><column-value><![CDATA[");
336                    sb.append(getLayoutId());
337                    sb.append("]]></column-value></column>");
338                    sb.append(
339                            "<column><column-name>portletId</column-name><column-value><![CDATA[");
340                    sb.append(getPortletId());
341                    sb.append("]]></column-value></column>");
342                    sb.append(
343                            "<column><column-name>articleId</column-name><column-value><![CDATA[");
344                    sb.append(getArticleId());
345                    sb.append("]]></column-value></column>");
346    
347                    sb.append("</model>");
348    
349                    return sb.toString();
350            }
351    
352            private long _contentSearchId;
353            private long _groupId;
354            private long _originalGroupId;
355            private boolean _setOriginalGroupId;
356            private long _companyId;
357            private boolean _privateLayout;
358            private boolean _originalPrivateLayout;
359            private boolean _setOriginalPrivateLayout;
360            private long _layoutId;
361            private long _originalLayoutId;
362            private boolean _setOriginalLayoutId;
363            private String _portletId;
364            private String _originalPortletId;
365            private String _articleId;
366            private String _originalArticleId;
367            private transient ExpandoBridge _expandoBridge;
368    }