1
22
23 package com.liferay.portal.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
55 public class UserIdMapperModelImpl extends BaseModelImpl {
56 public static String TABLE_NAME = "UserIdMapper";
57 public static Object[][] TABLE_COLUMNS = {
58 { "userIdMapperId", new Integer(Types.BIGINT) },
59 { "userId", new Integer(Types.BIGINT) },
60 { "type_", new Integer(Types.VARCHAR) },
61 { "description", new Integer(Types.VARCHAR) },
62 { "externalUserId", new Integer(Types.VARCHAR) }
63 };
64 public static String TABLE_SQL_CREATE = "create table UserIdMapper (userIdMapperId LONG not null primary key,userId LONG,type_ VARCHAR(75) null,description VARCHAR(75) null,externalUserId VARCHAR(75) null)";
65 public static String TABLE_SQL_DROP = "drop table UserIdMapper";
66 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
67 "xss.allow.com.liferay.portal.model.UserIdMapper"), XSS_ALLOW);
68 public static boolean XSS_ALLOW_TYPE = GetterUtil.getBoolean(PropsUtil.get(
69 "xss.allow.com.liferay.portal.model.UserIdMapper.type"),
70 XSS_ALLOW_BY_MODEL);
71 public static boolean XSS_ALLOW_DESCRIPTION = GetterUtil.getBoolean(PropsUtil.get(
72 "xss.allow.com.liferay.portal.model.UserIdMapper.description"),
73 XSS_ALLOW_BY_MODEL);
74 public static boolean XSS_ALLOW_EXTERNALUSERID = GetterUtil.getBoolean(PropsUtil.get(
75 "xss.allow.com.liferay.portal.model.UserIdMapper.externalUserId"),
76 XSS_ALLOW_BY_MODEL);
77 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
78 "lock.expiration.time.com.liferay.portal.model.UserIdMapperModel"));
79
80 public UserIdMapperModelImpl() {
81 }
82
83 public long getPrimaryKey() {
84 return _userIdMapperId;
85 }
86
87 public void setPrimaryKey(long pk) {
88 setUserIdMapperId(pk);
89 }
90
91 public Serializable getPrimaryKeyObj() {
92 return new Long(_userIdMapperId);
93 }
94
95 public long getUserIdMapperId() {
96 return _userIdMapperId;
97 }
98
99 public void setUserIdMapperId(long userIdMapperId) {
100 if (userIdMapperId != _userIdMapperId) {
101 _userIdMapperId = userIdMapperId;
102 }
103 }
104
105 public long getUserId() {
106 return _userId;
107 }
108
109 public void setUserId(long userId) {
110 if (userId != _userId) {
111 _userId = userId;
112 }
113 }
114
115 public String getType() {
116 return GetterUtil.getString(_type);
117 }
118
119 public void setType(String type) {
120 if (((type == null) && (_type != null)) ||
121 ((type != null) && (_type == null)) ||
122 ((type != null) && (_type != null) && !type.equals(_type))) {
123 if (!XSS_ALLOW_TYPE) {
124 type = XSSUtil.strip(type);
125 }
126
127 _type = type;
128 }
129 }
130
131 public String getDescription() {
132 return GetterUtil.getString(_description);
133 }
134
135 public void setDescription(String description) {
136 if (((description == null) && (_description != null)) ||
137 ((description != null) && (_description == null)) ||
138 ((description != null) && (_description != null) &&
139 !description.equals(_description))) {
140 if (!XSS_ALLOW_DESCRIPTION) {
141 description = XSSUtil.strip(description);
142 }
143
144 _description = description;
145 }
146 }
147
148 public String getExternalUserId() {
149 return GetterUtil.getString(_externalUserId);
150 }
151
152 public void setExternalUserId(String externalUserId) {
153 if (((externalUserId == null) && (_externalUserId != null)) ||
154 ((externalUserId != null) && (_externalUserId == null)) ||
155 ((externalUserId != null) && (_externalUserId != null) &&
156 !externalUserId.equals(_externalUserId))) {
157 if (!XSS_ALLOW_EXTERNALUSERID) {
158 externalUserId = XSSUtil.strip(externalUserId);
159 }
160
161 _externalUserId = externalUserId;
162 }
163 }
164
165 public Object clone() {
166 UserIdMapperImpl clone = new UserIdMapperImpl();
167 clone.setUserIdMapperId(getUserIdMapperId());
168 clone.setUserId(getUserId());
169 clone.setType(getType());
170 clone.setDescription(getDescription());
171 clone.setExternalUserId(getExternalUserId());
172
173 return clone;
174 }
175
176 public int compareTo(Object obj) {
177 if (obj == null) {
178 return -1;
179 }
180
181 UserIdMapperImpl userIdMapper = (UserIdMapperImpl)obj;
182 long pk = userIdMapper.getPrimaryKey();
183
184 if (getPrimaryKey() < pk) {
185 return -1;
186 }
187 else if (getPrimaryKey() > pk) {
188 return 1;
189 }
190 else {
191 return 0;
192 }
193 }
194
195 public boolean equals(Object obj) {
196 if (obj == null) {
197 return false;
198 }
199
200 UserIdMapperImpl userIdMapper = null;
201
202 try {
203 userIdMapper = (UserIdMapperImpl)obj;
204 }
205 catch (ClassCastException cce) {
206 return false;
207 }
208
209 long pk = userIdMapper.getPrimaryKey();
210
211 if (getPrimaryKey() == pk) {
212 return true;
213 }
214 else {
215 return false;
216 }
217 }
218
219 public int hashCode() {
220 return (int)getPrimaryKey();
221 }
222
223 private long _userIdMapperId;
224 private long _userId;
225 private String _type;
226 private String _description;
227 private String _externalUserId;
228 }