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