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 com.liferay.portlet.expando.model.ExpandoBridge;
32 import com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl;
33
34 import java.io.Serializable;
35
36 import java.lang.reflect.Proxy;
37
38 import java.sql.Types;
39
40 import java.util.ArrayList;
41 import java.util.List;
42
43
63 public class PluginSettingModelImpl extends BaseModelImpl<PluginSetting> {
64 public static final String TABLE_NAME = "PluginSetting";
65 public static final Object[][] TABLE_COLUMNS = {
66 { "pluginSettingId", new Integer(Types.BIGINT) },
67
68
69 { "companyId", new Integer(Types.BIGINT) },
70
71
72 { "pluginId", new Integer(Types.VARCHAR) },
73
74
75 { "pluginType", new Integer(Types.VARCHAR) },
76
77
78 { "roles", new Integer(Types.VARCHAR) },
79
80
81 { "active_", new Integer(Types.BOOLEAN) }
82 };
83 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)";
84 public static final String TABLE_SQL_DROP = "drop table PluginSetting";
85 public static final String DATA_SOURCE = "liferayDataSource";
86 public static final String SESSION_FACTORY = "liferaySessionFactory";
87 public static final String TX_MANAGER = "liferayTransactionManager";
88 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
89 "value.object.entity.cache.enabled.com.liferay.portal.model.PluginSetting"),
90 true);
91 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
92 "value.object.finder.cache.enabled.com.liferay.portal.model.PluginSetting"),
93 true);
94
95 public static PluginSetting toModel(PluginSettingSoap soapModel) {
96 PluginSetting model = new PluginSettingImpl();
97
98 model.setPluginSettingId(soapModel.getPluginSettingId());
99 model.setCompanyId(soapModel.getCompanyId());
100 model.setPluginId(soapModel.getPluginId());
101 model.setPluginType(soapModel.getPluginType());
102 model.setRoles(soapModel.getRoles());
103 model.setActive(soapModel.getActive());
104
105 return model;
106 }
107
108 public static List<PluginSetting> toModels(PluginSettingSoap[] soapModels) {
109 List<PluginSetting> models = new ArrayList<PluginSetting>(soapModels.length);
110
111 for (PluginSettingSoap soapModel : soapModels) {
112 models.add(toModel(soapModel));
113 }
114
115 return models;
116 }
117
118 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
119 "lock.expiration.time.com.liferay.portal.model.PluginSetting"));
120
121 public PluginSettingModelImpl() {
122 }
123
124 public long getPrimaryKey() {
125 return _pluginSettingId;
126 }
127
128 public void setPrimaryKey(long pk) {
129 setPluginSettingId(pk);
130 }
131
132 public Serializable getPrimaryKeyObj() {
133 return new Long(_pluginSettingId);
134 }
135
136 public long getPluginSettingId() {
137 return _pluginSettingId;
138 }
139
140 public void setPluginSettingId(long pluginSettingId) {
141 _pluginSettingId = pluginSettingId;
142 }
143
144 public long getCompanyId() {
145 return _companyId;
146 }
147
148 public void setCompanyId(long companyId) {
149 _companyId = companyId;
150
151 if (!_setOriginalCompanyId) {
152 _setOriginalCompanyId = true;
153
154 _originalCompanyId = companyId;
155 }
156 }
157
158 public long getOriginalCompanyId() {
159 return _originalCompanyId;
160 }
161
162 public String getPluginId() {
163 return GetterUtil.getString(_pluginId);
164 }
165
166 public void setPluginId(String pluginId) {
167 _pluginId = pluginId;
168
169 if (_originalPluginId == null) {
170 _originalPluginId = pluginId;
171 }
172 }
173
174 public String getOriginalPluginId() {
175 return GetterUtil.getString(_originalPluginId);
176 }
177
178 public String getPluginType() {
179 return GetterUtil.getString(_pluginType);
180 }
181
182 public void setPluginType(String pluginType) {
183 _pluginType = pluginType;
184
185 if (_originalPluginType == null) {
186 _originalPluginType = pluginType;
187 }
188 }
189
190 public String getOriginalPluginType() {
191 return GetterUtil.getString(_originalPluginType);
192 }
193
194 public String getRoles() {
195 return GetterUtil.getString(_roles);
196 }
197
198 public void setRoles(String roles) {
199 _roles = roles;
200 }
201
202 public boolean getActive() {
203 return _active;
204 }
205
206 public boolean isActive() {
207 return _active;
208 }
209
210 public void setActive(boolean active) {
211 _active = active;
212 }
213
214 public PluginSetting toEscapedModel() {
215 if (isEscapedModel()) {
216 return (PluginSetting)this;
217 }
218 else {
219 PluginSetting model = new PluginSettingImpl();
220
221 model.setNew(isNew());
222 model.setEscapedModel(true);
223
224 model.setPluginSettingId(getPluginSettingId());
225 model.setCompanyId(getCompanyId());
226 model.setPluginId(HtmlUtil.escape(getPluginId()));
227 model.setPluginType(HtmlUtil.escape(getPluginType()));
228 model.setRoles(HtmlUtil.escape(getRoles()));
229 model.setActive(getActive());
230
231 model = (PluginSetting)Proxy.newProxyInstance(PluginSetting.class.getClassLoader(),
232 new Class[] { PluginSetting.class },
233 new ReadOnlyBeanHandler(model));
234
235 return model;
236 }
237 }
238
239 public ExpandoBridge getExpandoBridge() {
240 if (_expandoBridge == null) {
241 _expandoBridge = new ExpandoBridgeImpl(PluginSetting.class.getName(),
242 getPrimaryKey());
243 }
244
245 return _expandoBridge;
246 }
247
248 public Object clone() {
249 PluginSettingImpl clone = new PluginSettingImpl();
250
251 clone.setPluginSettingId(getPluginSettingId());
252 clone.setCompanyId(getCompanyId());
253 clone.setPluginId(getPluginId());
254 clone.setPluginType(getPluginType());
255 clone.setRoles(getRoles());
256 clone.setActive(getActive());
257
258 return clone;
259 }
260
261 public int compareTo(PluginSetting pluginSetting) {
262 long pk = pluginSetting.getPrimaryKey();
263
264 if (getPrimaryKey() < pk) {
265 return -1;
266 }
267 else if (getPrimaryKey() > pk) {
268 return 1;
269 }
270 else {
271 return 0;
272 }
273 }
274
275 public boolean equals(Object obj) {
276 if (obj == null) {
277 return false;
278 }
279
280 PluginSetting pluginSetting = null;
281
282 try {
283 pluginSetting = (PluginSetting)obj;
284 }
285 catch (ClassCastException cce) {
286 return false;
287 }
288
289 long pk = pluginSetting.getPrimaryKey();
290
291 if (getPrimaryKey() == pk) {
292 return true;
293 }
294 else {
295 return false;
296 }
297 }
298
299 public int hashCode() {
300 return (int)getPrimaryKey();
301 }
302
303 public String toString() {
304 StringBuilder sb = new StringBuilder();
305
306 sb.append("{pluginSettingId=");
307 sb.append(getPluginSettingId());
308 sb.append(", companyId=");
309 sb.append(getCompanyId());
310 sb.append(", pluginId=");
311 sb.append(getPluginId());
312 sb.append(", pluginType=");
313 sb.append(getPluginType());
314 sb.append(", roles=");
315 sb.append(getRoles());
316 sb.append(", active=");
317 sb.append(getActive());
318 sb.append("}");
319
320 return sb.toString();
321 }
322
323 public String toXmlString() {
324 StringBuilder sb = new StringBuilder();
325
326 sb.append("<model><model-name>");
327 sb.append("com.liferay.portal.model.PluginSetting");
328 sb.append("</model-name>");
329
330 sb.append(
331 "<column><column-name>pluginSettingId</column-name><column-value><![CDATA[");
332 sb.append(getPluginSettingId());
333 sb.append("]]></column-value></column>");
334 sb.append(
335 "<column><column-name>companyId</column-name><column-value><![CDATA[");
336 sb.append(getCompanyId());
337 sb.append("]]></column-value></column>");
338 sb.append(
339 "<column><column-name>pluginId</column-name><column-value><![CDATA[");
340 sb.append(getPluginId());
341 sb.append("]]></column-value></column>");
342 sb.append(
343 "<column><column-name>pluginType</column-name><column-value><![CDATA[");
344 sb.append(getPluginType());
345 sb.append("]]></column-value></column>");
346 sb.append(
347 "<column><column-name>roles</column-name><column-value><![CDATA[");
348 sb.append(getRoles());
349 sb.append("]]></column-value></column>");
350 sb.append(
351 "<column><column-name>active</column-name><column-value><![CDATA[");
352 sb.append(getActive());
353 sb.append("]]></column-value></column>");
354
355 sb.append("</model>");
356
357 return sb.toString();
358 }
359
360 private long _pluginSettingId;
361 private long _companyId;
362 private long _originalCompanyId;
363 private boolean _setOriginalCompanyId;
364 private String _pluginId;
365 private String _originalPluginId;
366 private String _pluginType;
367 private String _originalPluginType;
368 private String _roles;
369 private boolean _active;
370 private transient ExpandoBridge _expandoBridge;
371 }