1
22
23 package com.liferay.portlet.messageboards.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.impl.BaseModelImpl;
29
30 import com.liferay.portlet.messageboards.model.MBBan;
31 import com.liferay.portlet.messageboards.model.MBBanSoap;
32
33 import java.io.Serializable;
34
35 import java.lang.reflect.Proxy;
36
37 import java.sql.Types;
38
39 import java.util.ArrayList;
40 import java.util.Date;
41 import java.util.List;
42
43
63 public class MBBanModelImpl extends BaseModelImpl {
64 public static final String TABLE_NAME = "MBBan";
65 public static final Object[][] TABLE_COLUMNS = {
66 { "banId", new Integer(Types.BIGINT) },
67
68
69 { "groupId", new Integer(Types.BIGINT) },
70
71
72 { "companyId", new Integer(Types.BIGINT) },
73
74
75 { "userId", new Integer(Types.BIGINT) },
76
77
78 { "userName", new Integer(Types.VARCHAR) },
79
80
81 { "createDate", new Integer(Types.TIMESTAMP) },
82
83
84 { "modifiedDate", new Integer(Types.TIMESTAMP) },
85
86
87 { "banUserId", new Integer(Types.BIGINT) }
88 };
89 public static final String TABLE_SQL_CREATE = "create table MBBan (banId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,banUserId LONG)";
90 public static final String TABLE_SQL_DROP = "drop table MBBan";
91 public static final String DATA_SOURCE = "liferayDataSource";
92 public static final String SESSION_FACTORY = "liferaySessionFactory";
93 public static final String TX_MANAGER = "liferayTransactionManager";
94 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
95 "value.object.finder.cache.enabled.com.liferay.portlet.messageboards.model.MBBan"),
96 true);
97
98 public static MBBan toModel(MBBanSoap soapModel) {
99 MBBan model = new MBBanImpl();
100
101 model.setBanId(soapModel.getBanId());
102 model.setGroupId(soapModel.getGroupId());
103 model.setCompanyId(soapModel.getCompanyId());
104 model.setUserId(soapModel.getUserId());
105 model.setUserName(soapModel.getUserName());
106 model.setCreateDate(soapModel.getCreateDate());
107 model.setModifiedDate(soapModel.getModifiedDate());
108 model.setBanUserId(soapModel.getBanUserId());
109
110 return model;
111 }
112
113 public static List<MBBan> toModels(MBBanSoap[] soapModels) {
114 List<MBBan> models = new ArrayList<MBBan>(soapModels.length);
115
116 for (MBBanSoap soapModel : soapModels) {
117 models.add(toModel(soapModel));
118 }
119
120 return models;
121 }
122
123 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
124 "lock.expiration.time.com.liferay.portlet.messageboards.model.MBBan"));
125
126 public MBBanModelImpl() {
127 }
128
129 public long getPrimaryKey() {
130 return _banId;
131 }
132
133 public void setPrimaryKey(long pk) {
134 setBanId(pk);
135 }
136
137 public Serializable getPrimaryKeyObj() {
138 return new Long(_banId);
139 }
140
141 public long getBanId() {
142 return _banId;
143 }
144
145 public void setBanId(long banId) {
146 if (banId != _banId) {
147 _banId = banId;
148 }
149 }
150
151 public long getGroupId() {
152 return _groupId;
153 }
154
155 public void setGroupId(long groupId) {
156 if (groupId != _groupId) {
157 _groupId = groupId;
158 }
159 }
160
161 public long getCompanyId() {
162 return _companyId;
163 }
164
165 public void setCompanyId(long companyId) {
166 if (companyId != _companyId) {
167 _companyId = companyId;
168 }
169 }
170
171 public long getUserId() {
172 return _userId;
173 }
174
175 public void setUserId(long userId) {
176 if (userId != _userId) {
177 _userId = userId;
178 }
179 }
180
181 public String getUserName() {
182 return GetterUtil.getString(_userName);
183 }
184
185 public void setUserName(String userName) {
186 if (((userName == null) && (_userName != null)) ||
187 ((userName != null) && (_userName == null)) ||
188 ((userName != null) && (_userName != null) &&
189 !userName.equals(_userName))) {
190 _userName = userName;
191 }
192 }
193
194 public Date getCreateDate() {
195 return _createDate;
196 }
197
198 public void setCreateDate(Date createDate) {
199 if (((createDate == null) && (_createDate != null)) ||
200 ((createDate != null) && (_createDate == null)) ||
201 ((createDate != null) && (_createDate != null) &&
202 !createDate.equals(_createDate))) {
203 _createDate = createDate;
204 }
205 }
206
207 public Date getModifiedDate() {
208 return _modifiedDate;
209 }
210
211 public void setModifiedDate(Date modifiedDate) {
212 if (((modifiedDate == null) && (_modifiedDate != null)) ||
213 ((modifiedDate != null) && (_modifiedDate == null)) ||
214 ((modifiedDate != null) && (_modifiedDate != null) &&
215 !modifiedDate.equals(_modifiedDate))) {
216 _modifiedDate = modifiedDate;
217 }
218 }
219
220 public long getBanUserId() {
221 return _banUserId;
222 }
223
224 public void setBanUserId(long banUserId) {
225 if (banUserId != _banUserId) {
226 _banUserId = banUserId;
227 }
228 }
229
230 public MBBan toEscapedModel() {
231 if (isEscapedModel()) {
232 return (MBBan)this;
233 }
234 else {
235 MBBan model = new MBBanImpl();
236
237 model.setNew(isNew());
238 model.setEscapedModel(true);
239
240 model.setBanId(getBanId());
241 model.setGroupId(getGroupId());
242 model.setCompanyId(getCompanyId());
243 model.setUserId(getUserId());
244 model.setUserName(HtmlUtil.escape(getUserName()));
245 model.setCreateDate(getCreateDate());
246 model.setModifiedDate(getModifiedDate());
247 model.setBanUserId(getBanUserId());
248
249 model = (MBBan)Proxy.newProxyInstance(MBBan.class.getClassLoader(),
250 new Class[] { MBBan.class }, new ReadOnlyBeanHandler(model));
251
252 return model;
253 }
254 }
255
256 public Object clone() {
257 MBBanImpl clone = new MBBanImpl();
258
259 clone.setBanId(getBanId());
260 clone.setGroupId(getGroupId());
261 clone.setCompanyId(getCompanyId());
262 clone.setUserId(getUserId());
263 clone.setUserName(getUserName());
264 clone.setCreateDate(getCreateDate());
265 clone.setModifiedDate(getModifiedDate());
266 clone.setBanUserId(getBanUserId());
267
268 return clone;
269 }
270
271 public int compareTo(Object obj) {
272 if (obj == null) {
273 return -1;
274 }
275
276 MBBanImpl mbBan = (MBBanImpl)obj;
277
278 long pk = mbBan.getPrimaryKey();
279
280 if (getPrimaryKey() < pk) {
281 return -1;
282 }
283 else if (getPrimaryKey() > pk) {
284 return 1;
285 }
286 else {
287 return 0;
288 }
289 }
290
291 public boolean equals(Object obj) {
292 if (obj == null) {
293 return false;
294 }
295
296 MBBanImpl mbBan = null;
297
298 try {
299 mbBan = (MBBanImpl)obj;
300 }
301 catch (ClassCastException cce) {
302 return false;
303 }
304
305 long pk = mbBan.getPrimaryKey();
306
307 if (getPrimaryKey() == pk) {
308 return true;
309 }
310 else {
311 return false;
312 }
313 }
314
315 public int hashCode() {
316 return (int)getPrimaryKey();
317 }
318
319 private long _banId;
320 private long _groupId;
321 private long _companyId;
322 private long _userId;
323 private String _userName;
324 private Date _createDate;
325 private Date _modifiedDate;
326 private long _banUserId;
327 }