001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.journal.model.impl;
022:
023: import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
024: import com.liferay.portal.kernel.util.GetterUtil;
025: import com.liferay.portal.model.impl.BaseModelImpl;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.portlet.journal.model.JournalStructure;
029:
030: import com.liferay.util.Html;
031:
032: import java.io.Serializable;
033:
034: import java.lang.reflect.Proxy;
035:
036: import java.sql.Types;
037:
038: import java.util.Date;
039:
040: /**
041: * <a href="JournalStructureModelImpl.java.html"><b><i>View Source</i></b></a>
042: *
043: * <p>
044: * ServiceBuilder generated this class. Modifications in this class will be
045: * overwritten the next time is generated.
046: * </p>
047: *
048: * <p>
049: * This class is a model that represents the <code>JournalStructure</code> table
050: * in the database.
051: * </p>
052: *
053: * @author Brian Wing Shun Chan
054: *
055: * @see com.liferay.portlet.journal.service.model.JournalStructure
056: * @see com.liferay.portlet.journal.service.model.JournalStructureModel
057: * @see com.liferay.portlet.journal.service.model.impl.JournalStructureImpl
058: *
059: */
060: public class JournalStructureModelImpl extends BaseModelImpl {
061: public static final String TABLE_NAME = "JournalStructure";
062: public static final Object[][] TABLE_COLUMNS = {
063: { "uuid_", new Integer(Types.VARCHAR) },
064:
065: { "id_", new Integer(Types.BIGINT) },
066:
067: { "groupId", new Integer(Types.BIGINT) },
068:
069: { "companyId", new Integer(Types.BIGINT) },
070:
071: { "userId", new Integer(Types.BIGINT) },
072:
073: { "userName", new Integer(Types.VARCHAR) },
074:
075: { "createDate", new Integer(Types.TIMESTAMP) },
076:
077: { "modifiedDate", new Integer(Types.TIMESTAMP) },
078:
079: { "structureId", new Integer(Types.VARCHAR) },
080:
081: { "name", new Integer(Types.VARCHAR) },
082:
083: { "description", new Integer(Types.VARCHAR) },
084:
085: { "xsd", new Integer(Types.CLOB) } };
086: public static final String TABLE_SQL_CREATE = "create table JournalStructure (uuid_ VARCHAR(75) null,id_ LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,structureId VARCHAR(75) null,name VARCHAR(75) null,description STRING null,xsd TEXT null)";
087: public static final String TABLE_SQL_DROP = "drop table JournalStructure";
088: public static final boolean CACHE_ENABLED = GetterUtil
089: .getBoolean(
090: PropsUtil
091: .get("value.object.finder.cache.enabled.com.liferay.portlet.journal.model.JournalStructure"),
092: true);
093: public static final long LOCK_EXPIRATION_TIME = GetterUtil
094: .getLong(PropsUtil
095: .get("lock.expiration.time.com.liferay.portlet.journal.model.JournalStructure"));
096:
097: public JournalStructureModelImpl() {
098: }
099:
100: public long getPrimaryKey() {
101: return _id;
102: }
103:
104: public void setPrimaryKey(long pk) {
105: setId(pk);
106: }
107:
108: public Serializable getPrimaryKeyObj() {
109: return new Long(_id);
110: }
111:
112: public String getUuid() {
113: return GetterUtil.getString(_uuid);
114: }
115:
116: public void setUuid(String uuid) {
117: if ((uuid != null) && (uuid != _uuid)) {
118: _uuid = uuid;
119: }
120: }
121:
122: public long getId() {
123: return _id;
124: }
125:
126: public void setId(long id) {
127: if (id != _id) {
128: _id = id;
129: }
130: }
131:
132: public long getGroupId() {
133: return _groupId;
134: }
135:
136: public void setGroupId(long groupId) {
137: if (groupId != _groupId) {
138: _groupId = groupId;
139: }
140: }
141:
142: public long getCompanyId() {
143: return _companyId;
144: }
145:
146: public void setCompanyId(long companyId) {
147: if (companyId != _companyId) {
148: _companyId = companyId;
149: }
150: }
151:
152: public long getUserId() {
153: return _userId;
154: }
155:
156: public void setUserId(long userId) {
157: if (userId != _userId) {
158: _userId = userId;
159: }
160: }
161:
162: public String getUserName() {
163: return GetterUtil.getString(_userName);
164: }
165:
166: public void setUserName(String userName) {
167: if (((userName == null) && (_userName != null))
168: || ((userName != null) && (_userName == null))
169: || ((userName != null) && (_userName != null) && !userName
170: .equals(_userName))) {
171: _userName = userName;
172: }
173: }
174:
175: public Date getCreateDate() {
176: return _createDate;
177: }
178:
179: public void setCreateDate(Date createDate) {
180: if (((createDate == null) && (_createDate != null))
181: || ((createDate != null) && (_createDate == null))
182: || ((createDate != null) && (_createDate != null) && !createDate
183: .equals(_createDate))) {
184: _createDate = createDate;
185: }
186: }
187:
188: public Date getModifiedDate() {
189: return _modifiedDate;
190: }
191:
192: public void setModifiedDate(Date modifiedDate) {
193: if (((modifiedDate == null) && (_modifiedDate != null))
194: || ((modifiedDate != null) && (_modifiedDate == null))
195: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
196: .equals(_modifiedDate))) {
197: _modifiedDate = modifiedDate;
198: }
199: }
200:
201: public String getStructureId() {
202: return GetterUtil.getString(_structureId);
203: }
204:
205: public void setStructureId(String structureId) {
206: if (((structureId == null) && (_structureId != null))
207: || ((structureId != null) && (_structureId == null))
208: || ((structureId != null) && (_structureId != null) && !structureId
209: .equals(_structureId))) {
210: _structureId = structureId;
211: }
212: }
213:
214: public String getName() {
215: return GetterUtil.getString(_name);
216: }
217:
218: public void setName(String name) {
219: if (((name == null) && (_name != null))
220: || ((name != null) && (_name == null))
221: || ((name != null) && (_name != null) && !name
222: .equals(_name))) {
223: _name = name;
224: }
225: }
226:
227: public String getDescription() {
228: return GetterUtil.getString(_description);
229: }
230:
231: public void setDescription(String description) {
232: if (((description == null) && (_description != null))
233: || ((description != null) && (_description == null))
234: || ((description != null) && (_description != null) && !description
235: .equals(_description))) {
236: _description = description;
237: }
238: }
239:
240: public String getXsd() {
241: return GetterUtil.getString(_xsd);
242: }
243:
244: public void setXsd(String xsd) {
245: if (((xsd == null) && (_xsd != null))
246: || ((xsd != null) && (_xsd == null))
247: || ((xsd != null) && (_xsd != null) && !xsd
248: .equals(_xsd))) {
249: _xsd = xsd;
250: }
251: }
252:
253: public JournalStructure toEscapedModel() {
254: if (isEscapedModel()) {
255: return (JournalStructure) this ;
256: } else {
257: JournalStructure model = new JournalStructureImpl();
258:
259: model.setEscapedModel(true);
260:
261: model.setUuid(Html.escape(getUuid()));
262: model.setId(getId());
263: model.setGroupId(getGroupId());
264: model.setCompanyId(getCompanyId());
265: model.setUserId(getUserId());
266: model.setUserName(Html.escape(getUserName()));
267: model.setCreateDate(getCreateDate());
268: model.setModifiedDate(getModifiedDate());
269: model.setStructureId(getStructureId());
270: model.setName(Html.escape(getName()));
271: model.setDescription(Html.escape(getDescription()));
272: model.setXsd(Html.escape(getXsd()));
273:
274: model = (JournalStructure) Proxy.newProxyInstance(
275: JournalStructure.class.getClassLoader(),
276: new Class[] { JournalStructure.class },
277: new ReadOnlyBeanHandler(model));
278:
279: return model;
280: }
281: }
282:
283: public Object clone() {
284: JournalStructureImpl clone = new JournalStructureImpl();
285:
286: clone.setUuid(getUuid());
287: clone.setId(getId());
288: clone.setGroupId(getGroupId());
289: clone.setCompanyId(getCompanyId());
290: clone.setUserId(getUserId());
291: clone.setUserName(getUserName());
292: clone.setCreateDate(getCreateDate());
293: clone.setModifiedDate(getModifiedDate());
294: clone.setStructureId(getStructureId());
295: clone.setName(getName());
296: clone.setDescription(getDescription());
297: clone.setXsd(getXsd());
298:
299: return clone;
300: }
301:
302: public int compareTo(Object obj) {
303: if (obj == null) {
304: return -1;
305: }
306:
307: JournalStructureImpl journalStructure = (JournalStructureImpl) obj;
308:
309: int value = 0;
310:
311: value = getStructureId().compareTo(
312: journalStructure.getStructureId());
313:
314: if (value != 0) {
315: return value;
316: }
317:
318: return 0;
319: }
320:
321: public boolean equals(Object obj) {
322: if (obj == null) {
323: return false;
324: }
325:
326: JournalStructureImpl journalStructure = null;
327:
328: try {
329: journalStructure = (JournalStructureImpl) obj;
330: } catch (ClassCastException cce) {
331: return false;
332: }
333:
334: long pk = journalStructure.getPrimaryKey();
335:
336: if (getPrimaryKey() == pk) {
337: return true;
338: } else {
339: return false;
340: }
341: }
342:
343: public int hashCode() {
344: return (int) getPrimaryKey();
345: }
346:
347: private String _uuid;
348: private long _id;
349: private long _groupId;
350: private long _companyId;
351: private long _userId;
352: private String _userName;
353: private Date _createDate;
354: private Date _modifiedDate;
355: private String _structureId;
356: private String _name;
357: private String _description;
358: private String _xsd;
359: }
|