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.portal.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.LayoutSet;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.util.Html;
029:
030: import java.io.Serializable;
031:
032: import java.lang.reflect.Proxy;
033:
034: import java.sql.Types;
035:
036: /**
037: * <a href="LayoutSetModelImpl.java.html"><b><i>View Source</i></b></a>
038: *
039: * <p>
040: * ServiceBuilder generated this class. Modifications in this class will be
041: * overwritten the next time is generated.
042: * </p>
043: *
044: * <p>
045: * This class is a model that represents the <code>LayoutSet</code> table
046: * in the database.
047: * </p>
048: *
049: * @author Brian Wing Shun Chan
050: *
051: * @see com.liferay.portal.service.model.LayoutSet
052: * @see com.liferay.portal.service.model.LayoutSetModel
053: * @see com.liferay.portal.service.model.impl.LayoutSetImpl
054: *
055: */
056: public class LayoutSetModelImpl extends BaseModelImpl {
057: public static final String TABLE_NAME = "LayoutSet";
058: public static final Object[][] TABLE_COLUMNS = {
059: { "layoutSetId", new Integer(Types.BIGINT) },
060:
061: { "groupId", new Integer(Types.BIGINT) },
062:
063: { "companyId", new Integer(Types.BIGINT) },
064:
065: { "privateLayout", new Integer(Types.BOOLEAN) },
066:
067: { "logo", new Integer(Types.BOOLEAN) },
068:
069: { "logoId", new Integer(Types.BIGINT) },
070:
071: { "themeId", new Integer(Types.VARCHAR) },
072:
073: { "colorSchemeId", new Integer(Types.VARCHAR) },
074:
075: { "wapThemeId", new Integer(Types.VARCHAR) },
076:
077: { "wapColorSchemeId", new Integer(Types.VARCHAR) },
078:
079: { "css", new Integer(Types.VARCHAR) },
080:
081: { "pageCount", new Integer(Types.INTEGER) },
082:
083: { "virtualHost", new Integer(Types.VARCHAR) } };
084: public static final String TABLE_SQL_CREATE = "create table LayoutSet (layoutSetId LONG not null primary key,groupId LONG,companyId LONG,privateLayout BOOLEAN,logo BOOLEAN,logoId LONG,themeId VARCHAR(75) null,colorSchemeId VARCHAR(75) null,wapThemeId VARCHAR(75) null,wapColorSchemeId VARCHAR(75) null,css VARCHAR(75) null,pageCount INTEGER,virtualHost VARCHAR(75) null)";
085: public static final String TABLE_SQL_DROP = "drop table LayoutSet";
086: public static final boolean CACHE_ENABLED = GetterUtil
087: .getBoolean(
088: PropsUtil
089: .get("value.object.finder.cache.enabled.com.liferay.portal.model.LayoutSet"),
090: true);
091: public static final long LOCK_EXPIRATION_TIME = GetterUtil
092: .getLong(PropsUtil
093: .get("lock.expiration.time.com.liferay.portal.model.LayoutSet"));
094:
095: public LayoutSetModelImpl() {
096: }
097:
098: public long getPrimaryKey() {
099: return _layoutSetId;
100: }
101:
102: public void setPrimaryKey(long pk) {
103: setLayoutSetId(pk);
104: }
105:
106: public Serializable getPrimaryKeyObj() {
107: return new Long(_layoutSetId);
108: }
109:
110: public long getLayoutSetId() {
111: return _layoutSetId;
112: }
113:
114: public void setLayoutSetId(long layoutSetId) {
115: if (layoutSetId != _layoutSetId) {
116: _layoutSetId = layoutSetId;
117: }
118: }
119:
120: public long getGroupId() {
121: return _groupId;
122: }
123:
124: public void setGroupId(long groupId) {
125: if (groupId != _groupId) {
126: _groupId = groupId;
127: }
128: }
129:
130: public long getCompanyId() {
131: return _companyId;
132: }
133:
134: public void setCompanyId(long companyId) {
135: if (companyId != _companyId) {
136: _companyId = companyId;
137: }
138: }
139:
140: public boolean getPrivateLayout() {
141: return _privateLayout;
142: }
143:
144: public boolean isPrivateLayout() {
145: return _privateLayout;
146: }
147:
148: public void setPrivateLayout(boolean privateLayout) {
149: if (privateLayout != _privateLayout) {
150: _privateLayout = privateLayout;
151: }
152: }
153:
154: public boolean getLogo() {
155: return _logo;
156: }
157:
158: public boolean isLogo() {
159: return _logo;
160: }
161:
162: public void setLogo(boolean logo) {
163: if (logo != _logo) {
164: _logo = logo;
165: }
166: }
167:
168: public long getLogoId() {
169: return _logoId;
170: }
171:
172: public void setLogoId(long logoId) {
173: if (logoId != _logoId) {
174: _logoId = logoId;
175: }
176: }
177:
178: public String getThemeId() {
179: return GetterUtil.getString(_themeId);
180: }
181:
182: public void setThemeId(String themeId) {
183: if (((themeId == null) && (_themeId != null))
184: || ((themeId != null) && (_themeId == null))
185: || ((themeId != null) && (_themeId != null) && !themeId
186: .equals(_themeId))) {
187: _themeId = themeId;
188: }
189: }
190:
191: public String getColorSchemeId() {
192: return GetterUtil.getString(_colorSchemeId);
193: }
194:
195: public void setColorSchemeId(String colorSchemeId) {
196: if (((colorSchemeId == null) && (_colorSchemeId != null))
197: || ((colorSchemeId != null) && (_colorSchemeId == null))
198: || ((colorSchemeId != null) && (_colorSchemeId != null) && !colorSchemeId
199: .equals(_colorSchemeId))) {
200: _colorSchemeId = colorSchemeId;
201: }
202: }
203:
204: public String getWapThemeId() {
205: return GetterUtil.getString(_wapThemeId);
206: }
207:
208: public void setWapThemeId(String wapThemeId) {
209: if (((wapThemeId == null) && (_wapThemeId != null))
210: || ((wapThemeId != null) && (_wapThemeId == null))
211: || ((wapThemeId != null) && (_wapThemeId != null) && !wapThemeId
212: .equals(_wapThemeId))) {
213: _wapThemeId = wapThemeId;
214: }
215: }
216:
217: public String getWapColorSchemeId() {
218: return GetterUtil.getString(_wapColorSchemeId);
219: }
220:
221: public void setWapColorSchemeId(String wapColorSchemeId) {
222: if (((wapColorSchemeId == null) && (_wapColorSchemeId != null))
223: || ((wapColorSchemeId != null) && (_wapColorSchemeId == null))
224: || ((wapColorSchemeId != null)
225: && (_wapColorSchemeId != null) && !wapColorSchemeId
226: .equals(_wapColorSchemeId))) {
227: _wapColorSchemeId = wapColorSchemeId;
228: }
229: }
230:
231: public String getCss() {
232: return GetterUtil.getString(_css);
233: }
234:
235: public void setCss(String css) {
236: if (((css == null) && (_css != null))
237: || ((css != null) && (_css == null))
238: || ((css != null) && (_css != null) && !css
239: .equals(_css))) {
240: _css = css;
241: }
242: }
243:
244: public int getPageCount() {
245: return _pageCount;
246: }
247:
248: public void setPageCount(int pageCount) {
249: if (pageCount != _pageCount) {
250: _pageCount = pageCount;
251: }
252: }
253:
254: public String getVirtualHost() {
255: return GetterUtil.getString(_virtualHost);
256: }
257:
258: public void setVirtualHost(String virtualHost) {
259: if (((virtualHost == null) && (_virtualHost != null))
260: || ((virtualHost != null) && (_virtualHost == null))
261: || ((virtualHost != null) && (_virtualHost != null) && !virtualHost
262: .equals(_virtualHost))) {
263: _virtualHost = virtualHost;
264: }
265: }
266:
267: public LayoutSet toEscapedModel() {
268: if (isEscapedModel()) {
269: return (LayoutSet) this ;
270: } else {
271: LayoutSet model = new LayoutSetImpl();
272:
273: model.setEscapedModel(true);
274:
275: model.setLayoutSetId(getLayoutSetId());
276: model.setGroupId(getGroupId());
277: model.setCompanyId(getCompanyId());
278: model.setPrivateLayout(getPrivateLayout());
279: model.setLogo(getLogo());
280: model.setLogoId(getLogoId());
281: model.setThemeId(Html.escape(getThemeId()));
282: model.setColorSchemeId(Html.escape(getColorSchemeId()));
283: model.setWapThemeId(Html.escape(getWapThemeId()));
284: model.setWapColorSchemeId(Html
285: .escape(getWapColorSchemeId()));
286: model.setCss(Html.escape(getCss()));
287: model.setPageCount(getPageCount());
288: model.setVirtualHost(Html.escape(getVirtualHost()));
289:
290: model = (LayoutSet) Proxy.newProxyInstance(LayoutSet.class
291: .getClassLoader(), new Class[] { LayoutSet.class },
292: new ReadOnlyBeanHandler(model));
293:
294: return model;
295: }
296: }
297:
298: public Object clone() {
299: LayoutSetImpl clone = new LayoutSetImpl();
300:
301: clone.setLayoutSetId(getLayoutSetId());
302: clone.setGroupId(getGroupId());
303: clone.setCompanyId(getCompanyId());
304: clone.setPrivateLayout(getPrivateLayout());
305: clone.setLogo(getLogo());
306: clone.setLogoId(getLogoId());
307: clone.setThemeId(getThemeId());
308: clone.setColorSchemeId(getColorSchemeId());
309: clone.setWapThemeId(getWapThemeId());
310: clone.setWapColorSchemeId(getWapColorSchemeId());
311: clone.setCss(getCss());
312: clone.setPageCount(getPageCount());
313: clone.setVirtualHost(getVirtualHost());
314:
315: return clone;
316: }
317:
318: public int compareTo(Object obj) {
319: if (obj == null) {
320: return -1;
321: }
322:
323: LayoutSetImpl layoutSet = (LayoutSetImpl) obj;
324:
325: long pk = layoutSet.getPrimaryKey();
326:
327: if (getPrimaryKey() < pk) {
328: return -1;
329: } else if (getPrimaryKey() > pk) {
330: return 1;
331: } else {
332: return 0;
333: }
334: }
335:
336: public boolean equals(Object obj) {
337: if (obj == null) {
338: return false;
339: }
340:
341: LayoutSetImpl layoutSet = null;
342:
343: try {
344: layoutSet = (LayoutSetImpl) obj;
345: } catch (ClassCastException cce) {
346: return false;
347: }
348:
349: long pk = layoutSet.getPrimaryKey();
350:
351: if (getPrimaryKey() == pk) {
352: return true;
353: } else {
354: return false;
355: }
356: }
357:
358: public int hashCode() {
359: return (int) getPrimaryKey();
360: }
361:
362: private long _layoutSetId;
363: private long _groupId;
364: private long _companyId;
365: private boolean _privateLayout;
366: private boolean _logo;
367: private long _logoId;
368: private String _themeId;
369: private String _colorSchemeId;
370: private String _wapThemeId;
371: private String _wapColorSchemeId;
372: private String _css;
373: private int _pageCount;
374: private String _virtualHost;
375: }
|