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