1
22
23 package com.liferay.portlet.journal.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 JournalArticleImageModelImpl extends BaseModelImpl {
56 public static String TABLE_NAME = "JournalArticleImage";
57 public static Object[][] TABLE_COLUMNS = {
58 { "articleImageId", new Integer(Types.BIGINT) },
59 { "groupId", new Integer(Types.BIGINT) },
60 { "articleId", new Integer(Types.VARCHAR) },
61 { "version", new Integer(Types.DOUBLE) },
62 { "elName", new Integer(Types.VARCHAR) },
63 { "languageId", new Integer(Types.VARCHAR) },
64 { "tempImage", new Integer(Types.BOOLEAN) }
65 };
66 public static String TABLE_SQL_CREATE = "create table JournalArticleImage (articleImageId LONG not null primary key,groupId LONG,articleId VARCHAR(75) null,version DOUBLE,elName VARCHAR(75) null,languageId VARCHAR(75) null,tempImage BOOLEAN)";
67 public static String TABLE_SQL_DROP = "drop table JournalArticleImage";
68 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
69 "xss.allow.com.liferay.portlet.journal.model.JournalArticleImage"),
70 XSS_ALLOW);
71 public static boolean XSS_ALLOW_ARTICLEID = GetterUtil.getBoolean(PropsUtil.get(
72 "xss.allow.com.liferay.portlet.journal.model.JournalArticleImage.articleId"),
73 XSS_ALLOW_BY_MODEL);
74 public static boolean XSS_ALLOW_ELNAME = GetterUtil.getBoolean(PropsUtil.get(
75 "xss.allow.com.liferay.portlet.journal.model.JournalArticleImage.elName"),
76 XSS_ALLOW_BY_MODEL);
77 public static boolean XSS_ALLOW_LANGUAGEID = GetterUtil.getBoolean(PropsUtil.get(
78 "xss.allow.com.liferay.portlet.journal.model.JournalArticleImage.languageId"),
79 XSS_ALLOW_BY_MODEL);
80 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
81 "lock.expiration.time.com.liferay.portlet.journal.model.JournalArticleImageModel"));
82
83 public JournalArticleImageModelImpl() {
84 }
85
86 public long getPrimaryKey() {
87 return _articleImageId;
88 }
89
90 public void setPrimaryKey(long pk) {
91 setArticleImageId(pk);
92 }
93
94 public Serializable getPrimaryKeyObj() {
95 return new Long(_articleImageId);
96 }
97
98 public long getArticleImageId() {
99 return _articleImageId;
100 }
101
102 public void setArticleImageId(long articleImageId) {
103 if (articleImageId != _articleImageId) {
104 _articleImageId = articleImageId;
105 }
106 }
107
108 public long getGroupId() {
109 return _groupId;
110 }
111
112 public void setGroupId(long groupId) {
113 if (groupId != _groupId) {
114 _groupId = groupId;
115 }
116 }
117
118 public String getArticleId() {
119 return GetterUtil.getString(_articleId);
120 }
121
122 public void setArticleId(String articleId) {
123 if (((articleId == null) && (_articleId != null)) ||
124 ((articleId != null) && (_articleId == null)) ||
125 ((articleId != null) && (_articleId != null) &&
126 !articleId.equals(_articleId))) {
127 if (!XSS_ALLOW_ARTICLEID) {
128 articleId = XSSUtil.strip(articleId);
129 }
130
131 _articleId = articleId;
132 }
133 }
134
135 public double getVersion() {
136 return _version;
137 }
138
139 public void setVersion(double version) {
140 if (version != _version) {
141 _version = version;
142 }
143 }
144
145 public String getElName() {
146 return GetterUtil.getString(_elName);
147 }
148
149 public void setElName(String elName) {
150 if (((elName == null) && (_elName != null)) ||
151 ((elName != null) && (_elName == null)) ||
152 ((elName != null) && (_elName != null) &&
153 !elName.equals(_elName))) {
154 if (!XSS_ALLOW_ELNAME) {
155 elName = XSSUtil.strip(elName);
156 }
157
158 _elName = elName;
159 }
160 }
161
162 public String getLanguageId() {
163 return GetterUtil.getString(_languageId);
164 }
165
166 public void setLanguageId(String languageId) {
167 if (((languageId == null) && (_languageId != null)) ||
168 ((languageId != null) && (_languageId == null)) ||
169 ((languageId != null) && (_languageId != null) &&
170 !languageId.equals(_languageId))) {
171 if (!XSS_ALLOW_LANGUAGEID) {
172 languageId = XSSUtil.strip(languageId);
173 }
174
175 _languageId = languageId;
176 }
177 }
178
179 public boolean getTempImage() {
180 return _tempImage;
181 }
182
183 public boolean isTempImage() {
184 return _tempImage;
185 }
186
187 public void setTempImage(boolean tempImage) {
188 if (tempImage != _tempImage) {
189 _tempImage = tempImage;
190 }
191 }
192
193 public Object clone() {
194 JournalArticleImageImpl clone = new JournalArticleImageImpl();
195 clone.setArticleImageId(getArticleImageId());
196 clone.setGroupId(getGroupId());
197 clone.setArticleId(getArticleId());
198 clone.setVersion(getVersion());
199 clone.setElName(getElName());
200 clone.setLanguageId(getLanguageId());
201 clone.setTempImage(getTempImage());
202
203 return clone;
204 }
205
206 public int compareTo(Object obj) {
207 if (obj == null) {
208 return -1;
209 }
210
211 JournalArticleImageImpl journalArticleImage = (JournalArticleImageImpl)obj;
212 long pk = journalArticleImage.getPrimaryKey();
213
214 if (getPrimaryKey() < pk) {
215 return -1;
216 }
217 else if (getPrimaryKey() > pk) {
218 return 1;
219 }
220 else {
221 return 0;
222 }
223 }
224
225 public boolean equals(Object obj) {
226 if (obj == null) {
227 return false;
228 }
229
230 JournalArticleImageImpl journalArticleImage = null;
231
232 try {
233 journalArticleImage = (JournalArticleImageImpl)obj;
234 }
235 catch (ClassCastException cce) {
236 return false;
237 }
238
239 long pk = journalArticleImage.getPrimaryKey();
240
241 if (getPrimaryKey() == pk) {
242 return true;
243 }
244 else {
245 return false;
246 }
247 }
248
249 public int hashCode() {
250 return (int)getPrimaryKey();
251 }
252
253 private long _articleImageId;
254 private long _groupId;
255 private String _articleId;
256 private double _version;
257 private String _elName;
258 private String _languageId;
259 private boolean _tempImage;
260 }