1
14
15 package com.liferay.portlet.tags.model.impl;
16
17 import com.liferay.portal.SystemException;
18 import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
19 import com.liferay.portal.kernel.util.GetterUtil;
20 import com.liferay.portal.kernel.util.StringBundler;
21 import com.liferay.portal.kernel.util.StringPool;
22 import com.liferay.portal.model.impl.BaseModelImpl;
23 import com.liferay.portal.service.ServiceContext;
24 import com.liferay.portal.util.PortalUtil;
25
26 import com.liferay.portlet.expando.model.ExpandoBridge;
27 import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
28 import com.liferay.portlet.tags.model.TagsEntry;
29 import com.liferay.portlet.tags.model.TagsEntrySoap;
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.Date;
39 import java.util.List;
40
41
60 public class TagsEntryModelImpl extends BaseModelImpl<TagsEntry> {
61 public static final String TABLE_NAME = "TagsEntry";
62 public static final Object[][] TABLE_COLUMNS = {
63 { "entryId", new Integer(Types.BIGINT) },
64 { "groupId", new Integer(Types.BIGINT) },
65 { "companyId", new Integer(Types.BIGINT) },
66 { "userId", new Integer(Types.BIGINT) },
67 { "userName", new Integer(Types.VARCHAR) },
68 { "createDate", new Integer(Types.TIMESTAMP) },
69 { "modifiedDate", new Integer(Types.TIMESTAMP) },
70 { "parentEntryId", new Integer(Types.BIGINT) },
71 { "name", new Integer(Types.VARCHAR) },
72 { "vocabularyId", new Integer(Types.BIGINT) }
73 };
74 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)";
75 public static final String TABLE_SQL_DROP = "drop table TagsEntry";
76 public static final String ORDER_BY_JPQL = " ORDER BY tagsEntry.name ASC";
77 public static final String ORDER_BY_SQL = " ORDER BY TagsEntry.name ASC";
78 public static final String DATA_SOURCE = "liferayDataSource";
79 public static final String SESSION_FACTORY = "liferaySessionFactory";
80 public static final String TX_MANAGER = "liferayTransactionManager";
81 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
82 "value.object.entity.cache.enabled.com.liferay.portlet.tags.model.TagsEntry"),
83 true);
84 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
85 "value.object.finder.cache.enabled.com.liferay.portlet.tags.model.TagsEntry"),
86 true);
87
88 public static TagsEntry toModel(TagsEntrySoap soapModel) {
89 TagsEntry model = new TagsEntryImpl();
90
91 model.setEntryId(soapModel.getEntryId());
92 model.setGroupId(soapModel.getGroupId());
93 model.setCompanyId(soapModel.getCompanyId());
94 model.setUserId(soapModel.getUserId());
95 model.setUserName(soapModel.getUserName());
96 model.setCreateDate(soapModel.getCreateDate());
97 model.setModifiedDate(soapModel.getModifiedDate());
98 model.setParentEntryId(soapModel.getParentEntryId());
99 model.setName(soapModel.getName());
100 model.setVocabularyId(soapModel.getVocabularyId());
101
102 return model;
103 }
104
105 public static List<TagsEntry> toModels(TagsEntrySoap[] soapModels) {
106 List<TagsEntry> models = new ArrayList<TagsEntry>(soapModels.length);
107
108 for (TagsEntrySoap soapModel : soapModels) {
109 models.add(toModel(soapModel));
110 }
111
112 return models;
113 }
114
115 public static final String MAPPING_TABLE_TAGSASSETS_TAGSENTRIES_NAME = com.liferay.portlet.tags.model.impl.TagsAssetModelImpl.MAPPING_TABLE_TAGSASSETS_TAGSENTRIES_NAME;
116 public static final boolean FINDER_CACHE_ENABLED_TAGSASSETS_TAGSENTRIES = com.liferay.portlet.tags.model.impl.TagsAssetModelImpl.FINDER_CACHE_ENABLED_TAGSASSETS_TAGSENTRIES;
117 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
118 "lock.expiration.time.com.liferay.portlet.tags.model.TagsEntry"));
119
120 public TagsEntryModelImpl() {
121 }
122
123 public long getPrimaryKey() {
124 return _entryId;
125 }
126
127 public void setPrimaryKey(long pk) {
128 setEntryId(pk);
129 }
130
131 public Serializable getPrimaryKeyObj() {
132 return new Long(_entryId);
133 }
134
135 public long getEntryId() {
136 return _entryId;
137 }
138
139 public void setEntryId(long entryId) {
140 _entryId = entryId;
141 }
142
143 public long getGroupId() {
144 return _groupId;
145 }
146
147 public void setGroupId(long groupId) {
148 _groupId = groupId;
149 }
150
151 public long getCompanyId() {
152 return _companyId;
153 }
154
155 public void setCompanyId(long companyId) {
156 _companyId = companyId;
157 }
158
159 public long getUserId() {
160 return _userId;
161 }
162
163 public void setUserId(long userId) {
164 _userId = userId;
165 }
166
167 public String getUserUuid() throws SystemException {
168 return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
169 }
170
171 public void setUserUuid(String userUuid) {
172 _userUuid = userUuid;
173 }
174
175 public String getUserName() {
176 if (_userName == null) {
177 return StringPool.BLANK;
178 }
179 else {
180 return _userName;
181 }
182 }
183
184 public void setUserName(String userName) {
185 _userName = userName;
186 }
187
188 public Date getCreateDate() {
189 return _createDate;
190 }
191
192 public void setCreateDate(Date createDate) {
193 _createDate = createDate;
194 }
195
196 public Date getModifiedDate() {
197 return _modifiedDate;
198 }
199
200 public void setModifiedDate(Date modifiedDate) {
201 _modifiedDate = modifiedDate;
202 }
203
204 public long getParentEntryId() {
205 return _parentEntryId;
206 }
207
208 public void setParentEntryId(long parentEntryId) {
209 _parentEntryId = parentEntryId;
210 }
211
212 public String getName() {
213 if (_name == null) {
214 return StringPool.BLANK;
215 }
216 else {
217 return _name;
218 }
219 }
220
221 public void setName(String name) {
222 _name = name;
223 }
224
225 public long getVocabularyId() {
226 return _vocabularyId;
227 }
228
229 public void setVocabularyId(long vocabularyId) {
230 _vocabularyId = vocabularyId;
231 }
232
233 public TagsEntry toEscapedModel() {
234 if (isEscapedModel()) {
235 return (TagsEntry)this;
236 }
237 else {
238 return (TagsEntry)Proxy.newProxyInstance(TagsEntry.class.getClassLoader(),
239 new Class[] { TagsEntry.class }, new AutoEscapeBeanHandler(this));
240 }
241 }
242
243 public ExpandoBridge getExpandoBridge() {
244 if (_expandoBridge == null) {
245 _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(TagsEntry.class.getName(),
246 getPrimaryKey());
247 }
248
249 return _expandoBridge;
250 }
251
252 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
253 getExpandoBridge().setAttributes(serviceContext);
254 }
255
256 public Object clone() {
257 TagsEntryImpl clone = new TagsEntryImpl();
258
259 clone.setEntryId(getEntryId());
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.setParentEntryId(getParentEntryId());
267 clone.setName(getName());
268 clone.setVocabularyId(getVocabularyId());
269
270 return clone;
271 }
272
273 public int compareTo(TagsEntry tagsEntry) {
274 int value = 0;
275
276 value = getName().compareTo(tagsEntry.getName());
277
278 if (value != 0) {
279 return value;
280 }
281
282 return 0;
283 }
284
285 public boolean equals(Object obj) {
286 if (obj == null) {
287 return false;
288 }
289
290 TagsEntry tagsEntry = null;
291
292 try {
293 tagsEntry = (TagsEntry)obj;
294 }
295 catch (ClassCastException cce) {
296 return false;
297 }
298
299 long pk = tagsEntry.getPrimaryKey();
300
301 if (getPrimaryKey() == pk) {
302 return true;
303 }
304 else {
305 return false;
306 }
307 }
308
309 public int hashCode() {
310 return (int)getPrimaryKey();
311 }
312
313 public String toString() {
314 StringBundler sb = new StringBundler(21);
315
316 sb.append("{entryId=");
317 sb.append(getEntryId());
318 sb.append(", groupId=");
319 sb.append(getGroupId());
320 sb.append(", companyId=");
321 sb.append(getCompanyId());
322 sb.append(", userId=");
323 sb.append(getUserId());
324 sb.append(", userName=");
325 sb.append(getUserName());
326 sb.append(", createDate=");
327 sb.append(getCreateDate());
328 sb.append(", modifiedDate=");
329 sb.append(getModifiedDate());
330 sb.append(", parentEntryId=");
331 sb.append(getParentEntryId());
332 sb.append(", name=");
333 sb.append(getName());
334 sb.append(", vocabularyId=");
335 sb.append(getVocabularyId());
336 sb.append("}");
337
338 return sb.toString();
339 }
340
341 public String toXmlString() {
342 StringBundler sb = new StringBundler(34);
343
344 sb.append("<model><model-name>");
345 sb.append("com.liferay.portlet.tags.model.TagsEntry");
346 sb.append("</model-name>");
347
348 sb.append(
349 "<column><column-name>entryId</column-name><column-value><![CDATA[");
350 sb.append(getEntryId());
351 sb.append("]]></column-value></column>");
352 sb.append(
353 "<column><column-name>groupId</column-name><column-value><![CDATA[");
354 sb.append(getGroupId());
355 sb.append("]]></column-value></column>");
356 sb.append(
357 "<column><column-name>companyId</column-name><column-value><![CDATA[");
358 sb.append(getCompanyId());
359 sb.append("]]></column-value></column>");
360 sb.append(
361 "<column><column-name>userId</column-name><column-value><![CDATA[");
362 sb.append(getUserId());
363 sb.append("]]></column-value></column>");
364 sb.append(
365 "<column><column-name>userName</column-name><column-value><![CDATA[");
366 sb.append(getUserName());
367 sb.append("]]></column-value></column>");
368 sb.append(
369 "<column><column-name>createDate</column-name><column-value><![CDATA[");
370 sb.append(getCreateDate());
371 sb.append("]]></column-value></column>");
372 sb.append(
373 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
374 sb.append(getModifiedDate());
375 sb.append("]]></column-value></column>");
376 sb.append(
377 "<column><column-name>parentEntryId</column-name><column-value><![CDATA[");
378 sb.append(getParentEntryId());
379 sb.append("]]></column-value></column>");
380 sb.append(
381 "<column><column-name>name</column-name><column-value><![CDATA[");
382 sb.append(getName());
383 sb.append("]]></column-value></column>");
384 sb.append(
385 "<column><column-name>vocabularyId</column-name><column-value><![CDATA[");
386 sb.append(getVocabularyId());
387 sb.append("]]></column-value></column>");
388
389 sb.append("</model>");
390
391 return sb.toString();
392 }
393
394 private long _entryId;
395 private long _groupId;
396 private long _companyId;
397 private long _userId;
398 private String _userUuid;
399 private String _userName;
400 private Date _createDate;
401 private Date _modifiedDate;
402 private long _parentEntryId;
403 private String _name;
404 private long _vocabularyId;
405 private transient ExpandoBridge _expandoBridge;
406 }