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.TagsEntry;
33 import com.liferay.portlet.tags.model.TagsEntrySoap;
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 TagsEntryModelImpl extends BaseModelImpl<TagsEntry> {
66 public static final String TABLE_NAME = "TagsEntry";
67 public static final Object[][] TABLE_COLUMNS = {
68 { "entryId", 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 { "parentEntryId", new Integer(Types.BIGINT) },
90
91
92 { "name", new Integer(Types.VARCHAR) },
93
94
95 { "vocabularyId", new Integer(Types.BIGINT) }
96 };
97 public static final String TABLE_SQL_CREATE = "create table TagsEntry (entryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,parentEntryId LONG,name VARCHAR(75) null,vocabularyId LONG)";
98 public static final String TABLE_SQL_DROP = "drop table TagsEntry";
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 ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
103 "value.object.entity.cache.enabled.com.liferay.portlet.tags.model.TagsEntry"),
104 true);
105 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
106 "value.object.finder.cache.enabled.com.liferay.portlet.tags.model.TagsEntry"),
107 true);
108
109 public static TagsEntry toModel(TagsEntrySoap soapModel) {
110 TagsEntry model = new TagsEntryImpl();
111
112 model.setEntryId(soapModel.getEntryId());
113 model.setGroupId(soapModel.getGroupId());
114 model.setCompanyId(soapModel.getCompanyId());
115 model.setUserId(soapModel.getUserId());
116 model.setUserName(soapModel.getUserName());
117 model.setCreateDate(soapModel.getCreateDate());
118 model.setModifiedDate(soapModel.getModifiedDate());
119 model.setParentEntryId(soapModel.getParentEntryId());
120 model.setName(soapModel.getName());
121 model.setVocabularyId(soapModel.getVocabularyId());
122
123 return model;
124 }
125
126 public static List<TagsEntry> toModels(TagsEntrySoap[] soapModels) {
127 List<TagsEntry> models = new ArrayList<TagsEntry>(soapModels.length);
128
129 for (TagsEntrySoap soapModel : soapModels) {
130 models.add(toModel(soapModel));
131 }
132
133 return models;
134 }
135
136 public static final boolean FINDER_CACHE_ENABLED_TAGSASSETS_TAGSENTRIES = com.liferay.portlet.tags.model.impl.TagsAssetModelImpl.FINDER_CACHE_ENABLED_TAGSASSETS_TAGSENTRIES;
137 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
138 "lock.expiration.time.com.liferay.portlet.tags.model.TagsEntry"));
139
140 public TagsEntryModelImpl() {
141 }
142
143 public long getPrimaryKey() {
144 return _entryId;
145 }
146
147 public void setPrimaryKey(long pk) {
148 setEntryId(pk);
149 }
150
151 public Serializable getPrimaryKeyObj() {
152 return new Long(_entryId);
153 }
154
155 public long getEntryId() {
156 return _entryId;
157 }
158
159 public void setEntryId(long entryId) {
160 _entryId = entryId;
161 }
162
163 public long getGroupId() {
164 return _groupId;
165 }
166
167 public void setGroupId(long groupId) {
168 _groupId = groupId;
169 }
170
171 public long getCompanyId() {
172 return _companyId;
173 }
174
175 public void setCompanyId(long companyId) {
176 _companyId = companyId;
177 }
178
179 public long getUserId() {
180 return _userId;
181 }
182
183 public void setUserId(long userId) {
184 _userId = userId;
185 }
186
187 public String getUserName() {
188 return GetterUtil.getString(_userName);
189 }
190
191 public void setUserName(String userName) {
192 _userName = userName;
193 }
194
195 public Date getCreateDate() {
196 return _createDate;
197 }
198
199 public void setCreateDate(Date createDate) {
200 _createDate = createDate;
201 }
202
203 public Date getModifiedDate() {
204 return _modifiedDate;
205 }
206
207 public void setModifiedDate(Date modifiedDate) {
208 _modifiedDate = modifiedDate;
209 }
210
211 public long getParentEntryId() {
212 return _parentEntryId;
213 }
214
215 public void setParentEntryId(long parentEntryId) {
216 _parentEntryId = parentEntryId;
217 }
218
219 public String getName() {
220 return GetterUtil.getString(_name);
221 }
222
223 public void setName(String name) {
224 _name = name;
225 }
226
227 public long getVocabularyId() {
228 return _vocabularyId;
229 }
230
231 public void setVocabularyId(long vocabularyId) {
232 _vocabularyId = vocabularyId;
233 }
234
235 public TagsEntry toEscapedModel() {
236 if (isEscapedModel()) {
237 return (TagsEntry)this;
238 }
239 else {
240 TagsEntry model = new TagsEntryImpl();
241
242 model.setNew(isNew());
243 model.setEscapedModel(true);
244
245 model.setEntryId(getEntryId());
246 model.setGroupId(getGroupId());
247 model.setCompanyId(getCompanyId());
248 model.setUserId(getUserId());
249 model.setUserName(HtmlUtil.escape(getUserName()));
250 model.setCreateDate(getCreateDate());
251 model.setModifiedDate(getModifiedDate());
252 model.setParentEntryId(getParentEntryId());
253 model.setName(HtmlUtil.escape(getName()));
254 model.setVocabularyId(getVocabularyId());
255
256 model = (TagsEntry)Proxy.newProxyInstance(TagsEntry.class.getClassLoader(),
257 new Class[] { TagsEntry.class },
258 new ReadOnlyBeanHandler(model));
259
260 return model;
261 }
262 }
263
264 public ExpandoBridge getExpandoBridge() {
265 if (_expandoBridge == null) {
266 _expandoBridge = new ExpandoBridgeImpl(TagsEntry.class.getName(),
267 getPrimaryKey());
268 }
269
270 return _expandoBridge;
271 }
272
273 public Object clone() {
274 TagsEntryImpl clone = new TagsEntryImpl();
275
276 clone.setEntryId(getEntryId());
277 clone.setGroupId(getGroupId());
278 clone.setCompanyId(getCompanyId());
279 clone.setUserId(getUserId());
280 clone.setUserName(getUserName());
281 clone.setCreateDate(getCreateDate());
282 clone.setModifiedDate(getModifiedDate());
283 clone.setParentEntryId(getParentEntryId());
284 clone.setName(getName());
285 clone.setVocabularyId(getVocabularyId());
286
287 return clone;
288 }
289
290 public int compareTo(TagsEntry tagsEntry) {
291 int value = 0;
292
293 value = getName().compareTo(tagsEntry.getName());
294
295 if (value != 0) {
296 return value;
297 }
298
299 return 0;
300 }
301
302 public boolean equals(Object obj) {
303 if (obj == null) {
304 return false;
305 }
306
307 TagsEntry tagsEntry = null;
308
309 try {
310 tagsEntry = (TagsEntry)obj;
311 }
312 catch (ClassCastException cce) {
313 return false;
314 }
315
316 long pk = tagsEntry.getPrimaryKey();
317
318 if (getPrimaryKey() == pk) {
319 return true;
320 }
321 else {
322 return false;
323 }
324 }
325
326 public int hashCode() {
327 return (int)getPrimaryKey();
328 }
329
330 public String toString() {
331 StringBuilder sb = new StringBuilder();
332
333 sb.append("{entryId=");
334 sb.append(getEntryId());
335 sb.append(", groupId=");
336 sb.append(getGroupId());
337 sb.append(", companyId=");
338 sb.append(getCompanyId());
339 sb.append(", userId=");
340 sb.append(getUserId());
341 sb.append(", userName=");
342 sb.append(getUserName());
343 sb.append(", createDate=");
344 sb.append(getCreateDate());
345 sb.append(", modifiedDate=");
346 sb.append(getModifiedDate());
347 sb.append(", parentEntryId=");
348 sb.append(getParentEntryId());
349 sb.append(", name=");
350 sb.append(getName());
351 sb.append(", vocabularyId=");
352 sb.append(getVocabularyId());
353 sb.append("}");
354
355 return sb.toString();
356 }
357
358 public String toXmlString() {
359 StringBuilder sb = new StringBuilder();
360
361 sb.append("<model><model-name>");
362 sb.append("com.liferay.portlet.tags.model.TagsEntry");
363 sb.append("</model-name>");
364
365 sb.append(
366 "<column><column-name>entryId</column-name><column-value><![CDATA[");
367 sb.append(getEntryId());
368 sb.append("]]></column-value></column>");
369 sb.append(
370 "<column><column-name>groupId</column-name><column-value><![CDATA[");
371 sb.append(getGroupId());
372 sb.append("]]></column-value></column>");
373 sb.append(
374 "<column><column-name>companyId</column-name><column-value><![CDATA[");
375 sb.append(getCompanyId());
376 sb.append("]]></column-value></column>");
377 sb.append(
378 "<column><column-name>userId</column-name><column-value><![CDATA[");
379 sb.append(getUserId());
380 sb.append("]]></column-value></column>");
381 sb.append(
382 "<column><column-name>userName</column-name><column-value><![CDATA[");
383 sb.append(getUserName());
384 sb.append("]]></column-value></column>");
385 sb.append(
386 "<column><column-name>createDate</column-name><column-value><![CDATA[");
387 sb.append(getCreateDate());
388 sb.append("]]></column-value></column>");
389 sb.append(
390 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
391 sb.append(getModifiedDate());
392 sb.append("]]></column-value></column>");
393 sb.append(
394 "<column><column-name>parentEntryId</column-name><column-value><![CDATA[");
395 sb.append(getParentEntryId());
396 sb.append("]]></column-value></column>");
397 sb.append(
398 "<column><column-name>name</column-name><column-value><![CDATA[");
399 sb.append(getName());
400 sb.append("]]></column-value></column>");
401 sb.append(
402 "<column><column-name>vocabularyId</column-name><column-value><![CDATA[");
403 sb.append(getVocabularyId());
404 sb.append("]]></column-value></column>");
405
406 sb.append("</model>");
407
408 return sb.toString();
409 }
410
411 private long _entryId;
412 private long _groupId;
413 private long _companyId;
414 private long _userId;
415 private String _userName;
416 private Date _createDate;
417 private Date _modifiedDate;
418 private long _parentEntryId;
419 private String _name;
420 private long _vocabularyId;
421 private transient ExpandoBridge _expandoBridge;
422 }