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