1
22
23 package com.liferay.portlet.tags.model.impl;
24
25 import com.liferay.portal.kernel.util.GetterUtil;
26 import com.liferay.portal.model.impl.BaseModelImpl;
27 import com.liferay.portal.util.PropsUtil;
28
29 import com.liferay.util.XSSUtil;
30
31 import java.io.Serializable;
32
33 import java.sql.Types;
34
35 import java.util.Date;
36
37
57 public class TagsEntryModelImpl extends BaseModelImpl {
58 public static String TABLE_NAME = "TagsEntry";
59 public static Object[][] TABLE_COLUMNS = {
60 { "entryId", new Integer(Types.BIGINT) },
61 { "companyId", new Integer(Types.BIGINT) },
62 { "userId", new Integer(Types.BIGINT) },
63 { "userName", new Integer(Types.VARCHAR) },
64 { "createDate", new Integer(Types.TIMESTAMP) },
65 { "modifiedDate", new Integer(Types.TIMESTAMP) },
66 { "name", new Integer(Types.VARCHAR) }
67 };
68 public static 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)";
69 public static String TABLE_SQL_DROP = "drop table TagsEntry";
70 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
71 "xss.allow.com.liferay.portlet.tags.model.TagsEntry"), XSS_ALLOW);
72 public static boolean XSS_ALLOW_USERNAME = GetterUtil.getBoolean(PropsUtil.get(
73 "xss.allow.com.liferay.portlet.tags.model.TagsEntry.userName"),
74 XSS_ALLOW_BY_MODEL);
75 public static boolean XSS_ALLOW_NAME = GetterUtil.getBoolean(PropsUtil.get(
76 "xss.allow.com.liferay.portlet.tags.model.TagsEntry.name"),
77 XSS_ALLOW_BY_MODEL);
78 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
79 "lock.expiration.time.com.liferay.portlet.tags.model.TagsEntryModel"));
80
81 public TagsEntryModelImpl() {
82 }
83
84 public long getPrimaryKey() {
85 return _entryId;
86 }
87
88 public void setPrimaryKey(long pk) {
89 setEntryId(pk);
90 }
91
92 public Serializable getPrimaryKeyObj() {
93 return new Long(_entryId);
94 }
95
96 public long getEntryId() {
97 return _entryId;
98 }
99
100 public void setEntryId(long entryId) {
101 if (entryId != _entryId) {
102 _entryId = entryId;
103 }
104 }
105
106 public long getCompanyId() {
107 return _companyId;
108 }
109
110 public void setCompanyId(long companyId) {
111 if (companyId != _companyId) {
112 _companyId = companyId;
113 }
114 }
115
116 public long getUserId() {
117 return _userId;
118 }
119
120 public void setUserId(long userId) {
121 if (userId != _userId) {
122 _userId = userId;
123 }
124 }
125
126 public String getUserName() {
127 return GetterUtil.getString(_userName);
128 }
129
130 public void setUserName(String userName) {
131 if (((userName == null) && (_userName != null)) ||
132 ((userName != null) && (_userName == null)) ||
133 ((userName != null) && (_userName != null) &&
134 !userName.equals(_userName))) {
135 if (!XSS_ALLOW_USERNAME) {
136 userName = XSSUtil.strip(userName);
137 }
138
139 _userName = userName;
140 }
141 }
142
143 public Date getCreateDate() {
144 return _createDate;
145 }
146
147 public void setCreateDate(Date createDate) {
148 if (((createDate == null) && (_createDate != null)) ||
149 ((createDate != null) && (_createDate == null)) ||
150 ((createDate != null) && (_createDate != null) &&
151 !createDate.equals(_createDate))) {
152 _createDate = createDate;
153 }
154 }
155
156 public Date getModifiedDate() {
157 return _modifiedDate;
158 }
159
160 public void setModifiedDate(Date modifiedDate) {
161 if (((modifiedDate == null) && (_modifiedDate != null)) ||
162 ((modifiedDate != null) && (_modifiedDate == null)) ||
163 ((modifiedDate != null) && (_modifiedDate != null) &&
164 !modifiedDate.equals(_modifiedDate))) {
165 _modifiedDate = modifiedDate;
166 }
167 }
168
169 public String getName() {
170 return GetterUtil.getString(_name);
171 }
172
173 public void setName(String name) {
174 if (((name == null) && (_name != null)) ||
175 ((name != null) && (_name == null)) ||
176 ((name != null) && (_name != null) && !name.equals(_name))) {
177 if (!XSS_ALLOW_NAME) {
178 name = XSSUtil.strip(name);
179 }
180
181 _name = name;
182 }
183 }
184
185 public Object clone() {
186 TagsEntryImpl clone = new TagsEntryImpl();
187 clone.setEntryId(getEntryId());
188 clone.setCompanyId(getCompanyId());
189 clone.setUserId(getUserId());
190 clone.setUserName(getUserName());
191 clone.setCreateDate(getCreateDate());
192 clone.setModifiedDate(getModifiedDate());
193 clone.setName(getName());
194
195 return clone;
196 }
197
198 public int compareTo(Object obj) {
199 if (obj == null) {
200 return -1;
201 }
202
203 TagsEntryImpl tagsEntry = (TagsEntryImpl)obj;
204 int value = 0;
205 value = getName().compareTo(tagsEntry.getName());
206
207 if (value != 0) {
208 return value;
209 }
210
211 return 0;
212 }
213
214 public boolean equals(Object obj) {
215 if (obj == null) {
216 return false;
217 }
218
219 TagsEntryImpl tagsEntry = null;
220
221 try {
222 tagsEntry = (TagsEntryImpl)obj;
223 }
224 catch (ClassCastException cce) {
225 return false;
226 }
227
228 long pk = tagsEntry.getPrimaryKey();
229
230 if (getPrimaryKey() == pk) {
231 return true;
232 }
233 else {
234 return false;
235 }
236 }
237
238 public int hashCode() {
239 return (int)getPrimaryKey();
240 }
241
242 private long _entryId;
243 private long _companyId;
244 private long _userId;
245 private String _userName;
246 private Date _createDate;
247 private Date _modifiedDate;
248 private String _name;
249 }