1
22
23 package com.liferay.portal.model.impl;
24
25 import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26 import com.liferay.portal.kernel.util.GetterUtil;
27 import com.liferay.portal.kernel.util.HtmlUtil;
28 import com.liferay.portal.model.PluginSetting;
29 import com.liferay.portal.model.PluginSettingSoap;
30
31 import java.io.Serializable;
32
33 import java.lang.reflect.Proxy;
34
35 import java.sql.Types;
36
37 import java.util.ArrayList;
38 import java.util.List;
39
40
60 public class PluginSettingModelImpl extends BaseModelImpl {
61 public static final String TABLE_NAME = "PluginSetting";
62 public static final Object[][] TABLE_COLUMNS = {
63 { "pluginSettingId", new Integer(Types.BIGINT) },
64
65
66 { "companyId", new Integer(Types.BIGINT) },
67
68
69 { "pluginId", new Integer(Types.VARCHAR) },
70
71
72 { "pluginType", new Integer(Types.VARCHAR) },
73
74
75 { "roles", new Integer(Types.VARCHAR) },
76
77
78 { "active_", new Integer(Types.BOOLEAN) }
79 };
80 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)";
81 public static final String TABLE_SQL_DROP = "drop table PluginSetting";
82 public static final String DATA_SOURCE = "liferayDataSource";
83 public static final String SESSION_FACTORY = "liferaySessionFactory";
84 public static final String TX_MANAGER = "liferayTransactionManager";
85 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
86 "value.object.finder.cache.enabled.com.liferay.portal.model.PluginSetting"),
87 true);
88
89 public static PluginSetting toModel(PluginSettingSoap soapModel) {
90 PluginSetting model = new PluginSettingImpl();
91
92 model.setPluginSettingId(soapModel.getPluginSettingId());
93 model.setCompanyId(soapModel.getCompanyId());
94 model.setPluginId(soapModel.getPluginId());
95 model.setPluginType(soapModel.getPluginType());
96 model.setRoles(soapModel.getRoles());
97 model.setActive(soapModel.getActive());
98
99 return model;
100 }
101
102 public static List<PluginSetting> toModels(PluginSettingSoap[] soapModels) {
103 List<PluginSetting> models = new ArrayList<PluginSetting>(soapModels.length);
104
105 for (PluginSettingSoap soapModel : soapModels) {
106 models.add(toModel(soapModel));
107 }
108
109 return models;
110 }
111
112 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
113 "lock.expiration.time.com.liferay.portal.model.PluginSetting"));
114
115 public PluginSettingModelImpl() {
116 }
117
118 public long getPrimaryKey() {
119 return _pluginSettingId;
120 }
121
122 public void setPrimaryKey(long pk) {
123 setPluginSettingId(pk);
124 }
125
126 public Serializable getPrimaryKeyObj() {
127 return new Long(_pluginSettingId);
128 }
129
130 public long getPluginSettingId() {
131 return _pluginSettingId;
132 }
133
134 public void setPluginSettingId(long pluginSettingId) {
135 if (pluginSettingId != _pluginSettingId) {
136 _pluginSettingId = pluginSettingId;
137 }
138 }
139
140 public long getCompanyId() {
141 return _companyId;
142 }
143
144 public void setCompanyId(long companyId) {
145 if (companyId != _companyId) {
146 _companyId = companyId;
147 }
148 }
149
150 public String getPluginId() {
151 return GetterUtil.getString(_pluginId);
152 }
153
154 public void setPluginId(String pluginId) {
155 if (((pluginId == null) && (_pluginId != null)) ||
156 ((pluginId != null) && (_pluginId == null)) ||
157 ((pluginId != null) && (_pluginId != null) &&
158 !pluginId.equals(_pluginId))) {
159 _pluginId = pluginId;
160 }
161 }
162
163 public String getPluginType() {
164 return GetterUtil.getString(_pluginType);
165 }
166
167 public void setPluginType(String pluginType) {
168 if (((pluginType == null) && (_pluginType != null)) ||
169 ((pluginType != null) && (_pluginType == null)) ||
170 ((pluginType != null) && (_pluginType != null) &&
171 !pluginType.equals(_pluginType))) {
172 _pluginType = pluginType;
173 }
174 }
175
176 public String getRoles() {
177 return GetterUtil.getString(_roles);
178 }
179
180 public void setRoles(String roles) {
181 if (((roles == null) && (_roles != null)) ||
182 ((roles != null) && (_roles == null)) ||
183 ((roles != null) && (_roles != null) && !roles.equals(_roles))) {
184 _roles = roles;
185 }
186 }
187
188 public boolean getActive() {
189 return _active;
190 }
191
192 public boolean isActive() {
193 return _active;
194 }
195
196 public void setActive(boolean active) {
197 if (active != _active) {
198 _active = active;
199 }
200 }
201
202 public PluginSetting toEscapedModel() {
203 if (isEscapedModel()) {
204 return (PluginSetting)this;
205 }
206 else {
207 PluginSetting model = new PluginSettingImpl();
208
209 model.setNew(isNew());
210 model.setEscapedModel(true);
211
212 model.setPluginSettingId(getPluginSettingId());
213 model.setCompanyId(getCompanyId());
214 model.setPluginId(HtmlUtil.escape(getPluginId()));
215 model.setPluginType(HtmlUtil.escape(getPluginType()));
216 model.setRoles(HtmlUtil.escape(getRoles()));
217 model.setActive(getActive());
218
219 model = (PluginSetting)Proxy.newProxyInstance(PluginSetting.class.getClassLoader(),
220 new Class[] { PluginSetting.class },
221 new ReadOnlyBeanHandler(model));
222
223 return model;
224 }
225 }
226
227 public Object clone() {
228 PluginSettingImpl clone = new PluginSettingImpl();
229
230 clone.setPluginSettingId(getPluginSettingId());
231 clone.setCompanyId(getCompanyId());
232 clone.setPluginId(getPluginId());
233 clone.setPluginType(getPluginType());
234 clone.setRoles(getRoles());
235 clone.setActive(getActive());
236
237 return clone;
238 }
239
240 public int compareTo(Object obj) {
241 if (obj == null) {
242 return -1;
243 }
244
245 PluginSettingImpl pluginSetting = (PluginSettingImpl)obj;
246
247 long pk = pluginSetting.getPrimaryKey();
248
249 if (getPrimaryKey() < pk) {
250 return -1;
251 }
252 else if (getPrimaryKey() > pk) {
253 return 1;
254 }
255 else {
256 return 0;
257 }
258 }
259
260 public boolean equals(Object obj) {
261 if (obj == null) {
262 return false;
263 }
264
265 PluginSettingImpl pluginSetting = null;
266
267 try {
268 pluginSetting = (PluginSettingImpl)obj;
269 }
270 catch (ClassCastException cce) {
271 return false;
272 }
273
274 long pk = pluginSetting.getPrimaryKey();
275
276 if (getPrimaryKey() == pk) {
277 return true;
278 }
279 else {
280 return false;
281 }
282 }
283
284 public int hashCode() {
285 return (int)getPrimaryKey();
286 }
287
288 private long _pluginSettingId;
289 private long _companyId;
290 private String _pluginId;
291 private String _pluginType;
292 private String _roles;
293 private boolean _active;
294 }