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.PasswordPolicyRel;
026: import com.liferay.portal.util.PropsUtil;
027:
028: import java.io.Serializable;
029:
030: import java.lang.reflect.Proxy;
031:
032: import java.sql.Types;
033:
034: /**
035: * <a href="PasswordPolicyRelModelImpl.java.html"><b><i>View Source</i></b></a>
036: *
037: * <p>
038: * ServiceBuilder generated this class. Modifications in this class will be
039: * overwritten the next time is generated.
040: * </p>
041: *
042: * <p>
043: * This class is a model that represents the <code>PasswordPolicyRel</code> table
044: * in the database.
045: * </p>
046: *
047: * @author Brian Wing Shun Chan
048: *
049: * @see com.liferay.portal.service.model.PasswordPolicyRel
050: * @see com.liferay.portal.service.model.PasswordPolicyRelModel
051: * @see com.liferay.portal.service.model.impl.PasswordPolicyRelImpl
052: *
053: */
054: public class PasswordPolicyRelModelImpl extends BaseModelImpl {
055: public static final String TABLE_NAME = "PasswordPolicyRel";
056: public static final Object[][] TABLE_COLUMNS = {
057: { "passwordPolicyRelId", new Integer(Types.BIGINT) },
058:
059: { "passwordPolicyId", new Integer(Types.BIGINT) },
060:
061: { "classNameId", new Integer(Types.BIGINT) },
062:
063: { "classPK", new Integer(Types.BIGINT) } };
064: public static final String TABLE_SQL_CREATE = "create table PasswordPolicyRel (passwordPolicyRelId LONG not null primary key,passwordPolicyId LONG,classNameId LONG,classPK LONG)";
065: public static final String TABLE_SQL_DROP = "drop table PasswordPolicyRel";
066: public static final boolean CACHE_ENABLED = GetterUtil
067: .getBoolean(
068: PropsUtil
069: .get("value.object.finder.cache.enabled.com.liferay.portal.model.PasswordPolicyRel"),
070: true);
071: public static final long LOCK_EXPIRATION_TIME = GetterUtil
072: .getLong(PropsUtil
073: .get("lock.expiration.time.com.liferay.portal.model.PasswordPolicyRel"));
074:
075: public PasswordPolicyRelModelImpl() {
076: }
077:
078: public long getPrimaryKey() {
079: return _passwordPolicyRelId;
080: }
081:
082: public void setPrimaryKey(long pk) {
083: setPasswordPolicyRelId(pk);
084: }
085:
086: public Serializable getPrimaryKeyObj() {
087: return new Long(_passwordPolicyRelId);
088: }
089:
090: public long getPasswordPolicyRelId() {
091: return _passwordPolicyRelId;
092: }
093:
094: public void setPasswordPolicyRelId(long passwordPolicyRelId) {
095: if (passwordPolicyRelId != _passwordPolicyRelId) {
096: _passwordPolicyRelId = passwordPolicyRelId;
097: }
098: }
099:
100: public long getPasswordPolicyId() {
101: return _passwordPolicyId;
102: }
103:
104: public void setPasswordPolicyId(long passwordPolicyId) {
105: if (passwordPolicyId != _passwordPolicyId) {
106: _passwordPolicyId = passwordPolicyId;
107: }
108: }
109:
110: public long getClassNameId() {
111: return _classNameId;
112: }
113:
114: public void setClassNameId(long classNameId) {
115: if (classNameId != _classNameId) {
116: _classNameId = classNameId;
117: }
118: }
119:
120: public long getClassPK() {
121: return _classPK;
122: }
123:
124: public void setClassPK(long classPK) {
125: if (classPK != _classPK) {
126: _classPK = classPK;
127: }
128: }
129:
130: public PasswordPolicyRel toEscapedModel() {
131: if (isEscapedModel()) {
132: return (PasswordPolicyRel) this ;
133: } else {
134: PasswordPolicyRel model = new PasswordPolicyRelImpl();
135:
136: model.setEscapedModel(true);
137:
138: model.setPasswordPolicyRelId(getPasswordPolicyRelId());
139: model.setPasswordPolicyId(getPasswordPolicyId());
140: model.setClassNameId(getClassNameId());
141: model.setClassPK(getClassPK());
142:
143: model = (PasswordPolicyRel) Proxy.newProxyInstance(
144: PasswordPolicyRel.class.getClassLoader(),
145: new Class[] { PasswordPolicyRel.class },
146: new ReadOnlyBeanHandler(model));
147:
148: return model;
149: }
150: }
151:
152: public Object clone() {
153: PasswordPolicyRelImpl clone = new PasswordPolicyRelImpl();
154:
155: clone.setPasswordPolicyRelId(getPasswordPolicyRelId());
156: clone.setPasswordPolicyId(getPasswordPolicyId());
157: clone.setClassNameId(getClassNameId());
158: clone.setClassPK(getClassPK());
159:
160: return clone;
161: }
162:
163: public int compareTo(Object obj) {
164: if (obj == null) {
165: return -1;
166: }
167:
168: PasswordPolicyRelImpl passwordPolicyRel = (PasswordPolicyRelImpl) obj;
169:
170: long pk = passwordPolicyRel.getPrimaryKey();
171:
172: if (getPrimaryKey() < pk) {
173: return -1;
174: } else if (getPrimaryKey() > pk) {
175: return 1;
176: } else {
177: return 0;
178: }
179: }
180:
181: public boolean equals(Object obj) {
182: if (obj == null) {
183: return false;
184: }
185:
186: PasswordPolicyRelImpl passwordPolicyRel = null;
187:
188: try {
189: passwordPolicyRel = (PasswordPolicyRelImpl) obj;
190: } catch (ClassCastException cce) {
191: return false;
192: }
193:
194: long pk = passwordPolicyRel.getPrimaryKey();
195:
196: if (getPrimaryKey() == pk) {
197: return true;
198: } else {
199: return false;
200: }
201: }
202:
203: public int hashCode() {
204: return (int) getPrimaryKey();
205: }
206:
207: private long _passwordPolicyRelId;
208: private long _passwordPolicyId;
209: private long _classNameId;
210: private long _classPK;
211: }
|