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