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.portal.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.Account;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import com.liferay.util.Html;
029:
030: import java.io.Serializable;
031:
032: import java.lang.reflect.Proxy;
033:
034: import java.sql.Types;
035:
036: import java.util.Date;
037:
038: /**
039: * <a href="AccountModelImpl.java.html"><b><i>View Source</i></b></a>
040: *
041: * <p>
042: * ServiceBuilder generated this class. Modifications in this class will be
043: * overwritten the next time is generated.
044: * </p>
045: *
046: * <p>
047: * This class is a model that represents the <code>Account</code> table
048: * in the database.
049: * </p>
050: *
051: * @author Brian Wing Shun Chan
052: *
053: * @see com.liferay.portal.service.model.Account
054: * @see com.liferay.portal.service.model.AccountModel
055: * @see com.liferay.portal.service.model.impl.AccountImpl
056: *
057: */
058: public class AccountModelImpl extends BaseModelImpl {
059: public static final String TABLE_NAME = "Account_";
060: public static final Object[][] TABLE_COLUMNS = {
061: { "accountId", new Integer(Types.BIGINT) },
062:
063: { "companyId", new Integer(Types.BIGINT) },
064:
065: { "userId", new Integer(Types.BIGINT) },
066:
067: { "userName", new Integer(Types.VARCHAR) },
068:
069: { "createDate", new Integer(Types.TIMESTAMP) },
070:
071: { "modifiedDate", new Integer(Types.TIMESTAMP) },
072:
073: { "parentAccountId", new Integer(Types.BIGINT) },
074:
075: { "name", new Integer(Types.VARCHAR) },
076:
077: { "legalName", new Integer(Types.VARCHAR) },
078:
079: { "legalId", new Integer(Types.VARCHAR) },
080:
081: { "legalType", new Integer(Types.VARCHAR) },
082:
083: { "sicCode", new Integer(Types.VARCHAR) },
084:
085: { "tickerSymbol", new Integer(Types.VARCHAR) },
086:
087: { "industry", new Integer(Types.VARCHAR) },
088:
089: { "type_", new Integer(Types.VARCHAR) },
090:
091: { "size_", new Integer(Types.VARCHAR) } };
092: public static final String TABLE_SQL_CREATE = "create table Account_ (accountId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,parentAccountId LONG,name VARCHAR(75) null,legalName VARCHAR(75) null,legalId VARCHAR(75) null,legalType VARCHAR(75) null,sicCode VARCHAR(75) null,tickerSymbol VARCHAR(75) null,industry VARCHAR(75) null,type_ VARCHAR(75) null,size_ VARCHAR(75) null)";
093: public static final String TABLE_SQL_DROP = "drop table Account_";
094: public static final boolean CACHE_ENABLED = GetterUtil
095: .getBoolean(
096: PropsUtil
097: .get("value.object.finder.cache.enabled.com.liferay.portal.model.Account"),
098: true);
099: public static final long LOCK_EXPIRATION_TIME = GetterUtil
100: .getLong(PropsUtil
101: .get("lock.expiration.time.com.liferay.portal.model.Account"));
102:
103: public AccountModelImpl() {
104: }
105:
106: public long getPrimaryKey() {
107: return _accountId;
108: }
109:
110: public void setPrimaryKey(long pk) {
111: setAccountId(pk);
112: }
113:
114: public Serializable getPrimaryKeyObj() {
115: return new Long(_accountId);
116: }
117:
118: public long getAccountId() {
119: return _accountId;
120: }
121:
122: public void setAccountId(long accountId) {
123: if (accountId != _accountId) {
124: _accountId = accountId;
125: }
126: }
127:
128: public long getCompanyId() {
129: return _companyId;
130: }
131:
132: public void setCompanyId(long companyId) {
133: if (companyId != _companyId) {
134: _companyId = companyId;
135: }
136: }
137:
138: public long getUserId() {
139: return _userId;
140: }
141:
142: public void setUserId(long userId) {
143: if (userId != _userId) {
144: _userId = userId;
145: }
146: }
147:
148: public String getUserName() {
149: return GetterUtil.getString(_userName);
150: }
151:
152: public void setUserName(String userName) {
153: if (((userName == null) && (_userName != null))
154: || ((userName != null) && (_userName == null))
155: || ((userName != null) && (_userName != null) && !userName
156: .equals(_userName))) {
157: _userName = userName;
158: }
159: }
160:
161: public Date getCreateDate() {
162: return _createDate;
163: }
164:
165: public void setCreateDate(Date createDate) {
166: if (((createDate == null) && (_createDate != null))
167: || ((createDate != null) && (_createDate == null))
168: || ((createDate != null) && (_createDate != null) && !createDate
169: .equals(_createDate))) {
170: _createDate = createDate;
171: }
172: }
173:
174: public Date getModifiedDate() {
175: return _modifiedDate;
176: }
177:
178: public void setModifiedDate(Date modifiedDate) {
179: if (((modifiedDate == null) && (_modifiedDate != null))
180: || ((modifiedDate != null) && (_modifiedDate == null))
181: || ((modifiedDate != null) && (_modifiedDate != null) && !modifiedDate
182: .equals(_modifiedDate))) {
183: _modifiedDate = modifiedDate;
184: }
185: }
186:
187: public long getParentAccountId() {
188: return _parentAccountId;
189: }
190:
191: public void setParentAccountId(long parentAccountId) {
192: if (parentAccountId != _parentAccountId) {
193: _parentAccountId = parentAccountId;
194: }
195: }
196:
197: public String getName() {
198: return GetterUtil.getString(_name);
199: }
200:
201: public void setName(String name) {
202: if (((name == null) && (_name != null))
203: || ((name != null) && (_name == null))
204: || ((name != null) && (_name != null) && !name
205: .equals(_name))) {
206: _name = name;
207: }
208: }
209:
210: public String getLegalName() {
211: return GetterUtil.getString(_legalName);
212: }
213:
214: public void setLegalName(String legalName) {
215: if (((legalName == null) && (_legalName != null))
216: || ((legalName != null) && (_legalName == null))
217: || ((legalName != null) && (_legalName != null) && !legalName
218: .equals(_legalName))) {
219: _legalName = legalName;
220: }
221: }
222:
223: public String getLegalId() {
224: return GetterUtil.getString(_legalId);
225: }
226:
227: public void setLegalId(String legalId) {
228: if (((legalId == null) && (_legalId != null))
229: || ((legalId != null) && (_legalId == null))
230: || ((legalId != null) && (_legalId != null) && !legalId
231: .equals(_legalId))) {
232: _legalId = legalId;
233: }
234: }
235:
236: public String getLegalType() {
237: return GetterUtil.getString(_legalType);
238: }
239:
240: public void setLegalType(String legalType) {
241: if (((legalType == null) && (_legalType != null))
242: || ((legalType != null) && (_legalType == null))
243: || ((legalType != null) && (_legalType != null) && !legalType
244: .equals(_legalType))) {
245: _legalType = legalType;
246: }
247: }
248:
249: public String getSicCode() {
250: return GetterUtil.getString(_sicCode);
251: }
252:
253: public void setSicCode(String sicCode) {
254: if (((sicCode == null) && (_sicCode != null))
255: || ((sicCode != null) && (_sicCode == null))
256: || ((sicCode != null) && (_sicCode != null) && !sicCode
257: .equals(_sicCode))) {
258: _sicCode = sicCode;
259: }
260: }
261:
262: public String getTickerSymbol() {
263: return GetterUtil.getString(_tickerSymbol);
264: }
265:
266: public void setTickerSymbol(String tickerSymbol) {
267: if (((tickerSymbol == null) && (_tickerSymbol != null))
268: || ((tickerSymbol != null) && (_tickerSymbol == null))
269: || ((tickerSymbol != null) && (_tickerSymbol != null) && !tickerSymbol
270: .equals(_tickerSymbol))) {
271: _tickerSymbol = tickerSymbol;
272: }
273: }
274:
275: public String getIndustry() {
276: return GetterUtil.getString(_industry);
277: }
278:
279: public void setIndustry(String industry) {
280: if (((industry == null) && (_industry != null))
281: || ((industry != null) && (_industry == null))
282: || ((industry != null) && (_industry != null) && !industry
283: .equals(_industry))) {
284: _industry = industry;
285: }
286: }
287:
288: public String getType() {
289: return GetterUtil.getString(_type);
290: }
291:
292: public void setType(String type) {
293: if (((type == null) && (_type != null))
294: || ((type != null) && (_type == null))
295: || ((type != null) && (_type != null) && !type
296: .equals(_type))) {
297: _type = type;
298: }
299: }
300:
301: public String getSize() {
302: return GetterUtil.getString(_size);
303: }
304:
305: public void setSize(String size) {
306: if (((size == null) && (_size != null))
307: || ((size != null) && (_size == null))
308: || ((size != null) && (_size != null) && !size
309: .equals(_size))) {
310: _size = size;
311: }
312: }
313:
314: public Account toEscapedModel() {
315: if (isEscapedModel()) {
316: return (Account) this ;
317: } else {
318: Account model = new AccountImpl();
319:
320: model.setEscapedModel(true);
321:
322: model.setAccountId(getAccountId());
323: model.setCompanyId(getCompanyId());
324: model.setUserId(getUserId());
325: model.setUserName(Html.escape(getUserName()));
326: model.setCreateDate(getCreateDate());
327: model.setModifiedDate(getModifiedDate());
328: model.setParentAccountId(getParentAccountId());
329: model.setName(Html.escape(getName()));
330: model.setLegalName(Html.escape(getLegalName()));
331: model.setLegalId(Html.escape(getLegalId()));
332: model.setLegalType(Html.escape(getLegalType()));
333: model.setSicCode(Html.escape(getSicCode()));
334: model.setTickerSymbol(Html.escape(getTickerSymbol()));
335: model.setIndustry(Html.escape(getIndustry()));
336: model.setType(Html.escape(getType()));
337: model.setSize(Html.escape(getSize()));
338:
339: model = (Account) Proxy.newProxyInstance(Account.class
340: .getClassLoader(), new Class[] { Account.class },
341: new ReadOnlyBeanHandler(model));
342:
343: return model;
344: }
345: }
346:
347: public Object clone() {
348: AccountImpl clone = new AccountImpl();
349:
350: clone.setAccountId(getAccountId());
351: clone.setCompanyId(getCompanyId());
352: clone.setUserId(getUserId());
353: clone.setUserName(getUserName());
354: clone.setCreateDate(getCreateDate());
355: clone.setModifiedDate(getModifiedDate());
356: clone.setParentAccountId(getParentAccountId());
357: clone.setName(getName());
358: clone.setLegalName(getLegalName());
359: clone.setLegalId(getLegalId());
360: clone.setLegalType(getLegalType());
361: clone.setSicCode(getSicCode());
362: clone.setTickerSymbol(getTickerSymbol());
363: clone.setIndustry(getIndustry());
364: clone.setType(getType());
365: clone.setSize(getSize());
366:
367: return clone;
368: }
369:
370: public int compareTo(Object obj) {
371: if (obj == null) {
372: return -1;
373: }
374:
375: AccountImpl account = (AccountImpl) obj;
376:
377: long pk = account.getPrimaryKey();
378:
379: if (getPrimaryKey() < pk) {
380: return -1;
381: } else if (getPrimaryKey() > pk) {
382: return 1;
383: } else {
384: return 0;
385: }
386: }
387:
388: public boolean equals(Object obj) {
389: if (obj == null) {
390: return false;
391: }
392:
393: AccountImpl account = null;
394:
395: try {
396: account = (AccountImpl) obj;
397: } catch (ClassCastException cce) {
398: return false;
399: }
400:
401: long pk = account.getPrimaryKey();
402:
403: if (getPrimaryKey() == pk) {
404: return true;
405: } else {
406: return false;
407: }
408: }
409:
410: public int hashCode() {
411: return (int) getPrimaryKey();
412: }
413:
414: private long _accountId;
415: private long _companyId;
416: private long _userId;
417: private String _userName;
418: private Date _createDate;
419: private Date _modifiedDate;
420: private long _parentAccountId;
421: private String _name;
422: private String _legalName;
423: private String _legalId;
424: private String _legalType;
425: private String _sicCode;
426: private String _tickerSymbol;
427: private String _industry;
428: private String _type;
429: private String _size;
430: }
|