001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.journal.model.impl;
022:
023: import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
024: import com.liferay.portal.kernel.util.GetterUtil;
025: import com.liferay.portal.model.impl.BaseModelImpl;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.portlet.journal.model.JournalContentSearch;
029:
030: import com.liferay.util.Html;
031:
032: import java.io.Serializable;
033:
034: import java.lang.reflect.Proxy;
035:
036: import java.sql.Types;
037:
038: /**
039: * <a href="JournalContentSearchModelImpl.java.html"><b><i>View Source</i></b></a>
040: *
041: * <p>
042: * ServiceBuilder generated this class. Modifications in this class will be
043: * overwritten the next time is generated.
044: * </p>
045: *
046: * <p>
047: * This class is a model that represents the <code>JournalContentSearch</code> table
048: * in the database.
049: * </p>
050: *
051: * @author Brian Wing Shun Chan
052: *
053: * @see com.liferay.portlet.journal.service.model.JournalContentSearch
054: * @see com.liferay.portlet.journal.service.model.JournalContentSearchModel
055: * @see com.liferay.portlet.journal.service.model.impl.JournalContentSearchImpl
056: *
057: */
058: public class JournalContentSearchModelImpl extends BaseModelImpl {
059: public static final String TABLE_NAME = "JournalContentSearch";
060: public static final Object[][] TABLE_COLUMNS = {
061: { "contentSearchId", new Integer(Types.BIGINT) },
062:
063: { "groupId", new Integer(Types.BIGINT) },
064:
065: { "companyId", new Integer(Types.BIGINT) },
066:
067: { "privateLayout", new Integer(Types.BOOLEAN) },
068:
069: { "layoutId", new Integer(Types.BIGINT) },
070:
071: { "portletId", new Integer(Types.VARCHAR) },
072:
073: { "articleId", new Integer(Types.VARCHAR) } };
074: 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)";
075: public static final String TABLE_SQL_DROP = "drop table JournalContentSearch";
076: public static final boolean CACHE_ENABLED = GetterUtil
077: .getBoolean(
078: PropsUtil
079: .get("value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalContentSearch"),
080: true);
081: public static final long LOCK_EXPIRATION_TIME = GetterUtil
082: .getLong(PropsUtil
083: .get("lock.expiration.time.com.liferay.portlet.journal.model.JournalContentSearch"));
084:
085: public JournalContentSearchModelImpl() {
086: }
087:
088: public long getPrimaryKey() {
089: return _contentSearchId;
090: }
091:
092: public void setPrimaryKey(long pk) {
093: setContentSearchId(pk);
094: }
095:
096: public Serializable getPrimaryKeyObj() {
097: return new Long(_contentSearchId);
098: }
099:
100: public long getContentSearchId() {
101: return _contentSearchId;
102: }
103:
104: public void setContentSearchId(long contentSearchId) {
105: if (contentSearchId != _contentSearchId) {
106: _contentSearchId = contentSearchId;
107: }
108: }
109:
110: public long getGroupId() {
111: return _groupId;
112: }
113:
114: public void setGroupId(long groupId) {
115: if (groupId != _groupId) {
116: _groupId = groupId;
117: }
118: }
119:
120: public long getCompanyId() {
121: return _companyId;
122: }
123:
124: public void setCompanyId(long companyId) {
125: if (companyId != _companyId) {
126: _companyId = companyId;
127: }
128: }
129:
130: public boolean getPrivateLayout() {
131: return _privateLayout;
132: }
133:
134: public boolean isPrivateLayout() {
135: return _privateLayout;
136: }
137:
138: public void setPrivateLayout(boolean privateLayout) {
139: if (privateLayout != _privateLayout) {
140: _privateLayout = privateLayout;
141: }
142: }
143:
144: public long getLayoutId() {
145: return _layoutId;
146: }
147:
148: public void setLayoutId(long layoutId) {
149: if (layoutId != _layoutId) {
150: _layoutId = layoutId;
151: }
152: }
153:
154: public String getPortletId() {
155: return GetterUtil.getString(_portletId);
156: }
157:
158: public void setPortletId(String portletId) {
159: if (((portletId == null) && (_portletId != null))
160: || ((portletId != null) && (_portletId == null))
161: || ((portletId != null) && (_portletId != null) && !portletId
162: .equals(_portletId))) {
163: _portletId = portletId;
164: }
165: }
166:
167: public String getArticleId() {
168: return GetterUtil.getString(_articleId);
169: }
170:
171: public void setArticleId(String articleId) {
172: if (((articleId == null) && (_articleId != null))
173: || ((articleId != null) && (_articleId == null))
174: || ((articleId != null) && (_articleId != null) && !articleId
175: .equals(_articleId))) {
176: _articleId = articleId;
177: }
178: }
179:
180: public JournalContentSearch toEscapedModel() {
181: if (isEscapedModel()) {
182: return (JournalContentSearch) this ;
183: } else {
184: JournalContentSearch model = new JournalContentSearchImpl();
185:
186: model.setEscapedModel(true);
187:
188: model.setContentSearchId(getContentSearchId());
189: model.setGroupId(getGroupId());
190: model.setCompanyId(getCompanyId());
191: model.setPrivateLayout(getPrivateLayout());
192: model.setLayoutId(getLayoutId());
193: model.setPortletId(Html.escape(getPortletId()));
194: model.setArticleId(Html.escape(getArticleId()));
195:
196: model = (JournalContentSearch) Proxy.newProxyInstance(
197: JournalContentSearch.class.getClassLoader(),
198: new Class[] { JournalContentSearch.class },
199: new ReadOnlyBeanHandler(model));
200:
201: return model;
202: }
203: }
204:
205: public Object clone() {
206: JournalContentSearchImpl clone = new JournalContentSearchImpl();
207:
208: clone.setContentSearchId(getContentSearchId());
209: clone.setGroupId(getGroupId());
210: clone.setCompanyId(getCompanyId());
211: clone.setPrivateLayout(getPrivateLayout());
212: clone.setLayoutId(getLayoutId());
213: clone.setPortletId(getPortletId());
214: clone.setArticleId(getArticleId());
215:
216: return clone;
217: }
218:
219: public int compareTo(Object obj) {
220: if (obj == null) {
221: return -1;
222: }
223:
224: JournalContentSearchImpl journalContentSearch = (JournalContentSearchImpl) obj;
225:
226: long pk = journalContentSearch.getPrimaryKey();
227:
228: if (getPrimaryKey() < pk) {
229: return -1;
230: } else if (getPrimaryKey() > pk) {
231: return 1;
232: } else {
233: return 0;
234: }
235: }
236:
237: public boolean equals(Object obj) {
238: if (obj == null) {
239: return false;
240: }
241:
242: JournalContentSearchImpl journalContentSearch = null;
243:
244: try {
245: journalContentSearch = (JournalContentSearchImpl) obj;
246: } catch (ClassCastException cce) {
247: return false;
248: }
249:
250: long pk = journalContentSearch.getPrimaryKey();
251:
252: if (getPrimaryKey() == pk) {
253: return true;
254: } else {
255: return false;
256: }
257: }
258:
259: public int hashCode() {
260: return (int) getPrimaryKey();
261: }
262:
263: private long _contentSearchId;
264: private long _groupId;
265: private long _companyId;
266: private boolean _privateLayout;
267: private long _layoutId;
268: private String _portletId;
269: private String _articleId;
270: }
|