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.PluginSetting;
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="PluginSettingModelImpl.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>PluginSetting</code> table
046: * in the database.
047: * </p>
048: *
049: * @author Brian Wing Shun Chan
050: *
051: * @see com.liferay.portal.service.model.PluginSetting
052: * @see com.liferay.portal.service.model.PluginSettingModel
053: * @see com.liferay.portal.service.model.impl.PluginSettingImpl
054: *
055: */
056: public class PluginSettingModelImpl extends BaseModelImpl {
057: public static final String TABLE_NAME = "PluginSetting";
058: public static final Object[][] TABLE_COLUMNS = {
059: { "pluginSettingId", new Integer(Types.BIGINT) },
060:
061: { "companyId", new Integer(Types.BIGINT) },
062:
063: { "pluginId", new Integer(Types.VARCHAR) },
064:
065: { "pluginType", new Integer(Types.VARCHAR) },
066:
067: { "roles", new Integer(Types.VARCHAR) },
068:
069: { "active_", new Integer(Types.BOOLEAN) } };
070: public static final String TABLE_SQL_CREATE = "create table PluginSetting (pluginSettingId LONG not null primary key,companyId LONG,pluginId VARCHAR(75) null,pluginType VARCHAR(75) null,roles STRING null,active_ BOOLEAN)";
071: public static final String TABLE_SQL_DROP = "drop table PluginSetting";
072: public static final boolean CACHE_ENABLED = GetterUtil
073: .getBoolean(
074: PropsUtil
075: .get("value.object.finder.cache.enabled.com.liferay.portal.model.PluginSetting"),
076: true);
077: public static final long LOCK_EXPIRATION_TIME = GetterUtil
078: .getLong(PropsUtil
079: .get("lock.expiration.time.com.liferay.portal.model.PluginSetting"));
080:
081: public PluginSettingModelImpl() {
082: }
083:
084: public long getPrimaryKey() {
085: return _pluginSettingId;
086: }
087:
088: public void setPrimaryKey(long pk) {
089: setPluginSettingId(pk);
090: }
091:
092: public Serializable getPrimaryKeyObj() {
093: return new Long(_pluginSettingId);
094: }
095:
096: public long getPluginSettingId() {
097: return _pluginSettingId;
098: }
099:
100: public void setPluginSettingId(long pluginSettingId) {
101: if (pluginSettingId != _pluginSettingId) {
102: _pluginSettingId = pluginSettingId;
103: }
104: }
105:
106: public long getCompanyId() {
107: return _companyId;
108: }
109:
110: public void setCompanyId(long companyId) {
111: if (companyId != _companyId) {
112: _companyId = companyId;
113: }
114: }
115:
116: public String getPluginId() {
117: return GetterUtil.getString(_pluginId);
118: }
119:
120: public void setPluginId(String pluginId) {
121: if (((pluginId == null) && (_pluginId != null))
122: || ((pluginId != null) && (_pluginId == null))
123: || ((pluginId != null) && (_pluginId != null) && !pluginId
124: .equals(_pluginId))) {
125: _pluginId = pluginId;
126: }
127: }
128:
129: public String getPluginType() {
130: return GetterUtil.getString(_pluginType);
131: }
132:
133: public void setPluginType(String pluginType) {
134: if (((pluginType == null) && (_pluginType != null))
135: || ((pluginType != null) && (_pluginType == null))
136: || ((pluginType != null) && (_pluginType != null) && !pluginType
137: .equals(_pluginType))) {
138: _pluginType = pluginType;
139: }
140: }
141:
142: public String getRoles() {
143: return GetterUtil.getString(_roles);
144: }
145:
146: public void setRoles(String roles) {
147: if (((roles == null) && (_roles != null))
148: || ((roles != null) && (_roles == null))
149: || ((roles != null) && (_roles != null) && !roles
150: .equals(_roles))) {
151: _roles = roles;
152: }
153: }
154:
155: public boolean getActive() {
156: return _active;
157: }
158:
159: public boolean isActive() {
160: return _active;
161: }
162:
163: public void setActive(boolean active) {
164: if (active != _active) {
165: _active = active;
166: }
167: }
168:
169: public PluginSetting toEscapedModel() {
170: if (isEscapedModel()) {
171: return (PluginSetting) this ;
172: } else {
173: PluginSetting model = new PluginSettingImpl();
174:
175: model.setEscapedModel(true);
176:
177: model.setPluginSettingId(getPluginSettingId());
178: model.setCompanyId(getCompanyId());
179: model.setPluginId(Html.escape(getPluginId()));
180: model.setPluginType(Html.escape(getPluginType()));
181: model.setRoles(Html.escape(getRoles()));
182: model.setActive(getActive());
183:
184: model = (PluginSetting) Proxy.newProxyInstance(
185: PluginSetting.class.getClassLoader(),
186: new Class[] { PluginSetting.class },
187: new ReadOnlyBeanHandler(model));
188:
189: return model;
190: }
191: }
192:
193: public Object clone() {
194: PluginSettingImpl clone = new PluginSettingImpl();
195:
196: clone.setPluginSettingId(getPluginSettingId());
197: clone.setCompanyId(getCompanyId());
198: clone.setPluginId(getPluginId());
199: clone.setPluginType(getPluginType());
200: clone.setRoles(getRoles());
201: clone.setActive(getActive());
202:
203: return clone;
204: }
205:
206: public int compareTo(Object obj) {
207: if (obj == null) {
208: return -1;
209: }
210:
211: PluginSettingImpl pluginSetting = (PluginSettingImpl) obj;
212:
213: long pk = pluginSetting.getPrimaryKey();
214:
215: if (getPrimaryKey() < pk) {
216: return -1;
217: } else if (getPrimaryKey() > pk) {
218: return 1;
219: } else {
220: return 0;
221: }
222: }
223:
224: public boolean equals(Object obj) {
225: if (obj == null) {
226: return false;
227: }
228:
229: PluginSettingImpl pluginSetting = null;
230:
231: try {
232: pluginSetting = (PluginSettingImpl) obj;
233: } catch (ClassCastException cce) {
234: return false;
235: }
236:
237: long pk = pluginSetting.getPrimaryKey();
238:
239: if (getPrimaryKey() == pk) {
240: return true;
241: } else {
242: return false;
243: }
244: }
245:
246: public int hashCode() {
247: return (int) getPrimaryKey();
248: }
249:
250: private long _pluginSettingId;
251: private long _companyId;
252: private String _pluginId;
253: private String _pluginType;
254: private String _roles;
255: private boolean _active;
256: }
|