1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
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 java.io.Serializable;
30  
31  import java.sql.Types;
32  
33  /**
34   * <a href="PasswordPolicyRelModelImpl.java.html"><b><i>View Source</i></b></a>
35   *
36   * <p>
37   * ServiceBuilder generated this class. Modifications in this class will be overwritten
38   * the next time is generated.
39   * </p>
40   *
41   * <p>
42   * This class is a model that represents the <code>PasswordPolicyRel</code> table
43   * in the database.
44   * </p>
45   *
46   * @author Brian Wing Shun Chan
47   *
48   * @see com.liferay.portal.service.model.PasswordPolicyRel
49   * @see com.liferay.portal.service.model.PasswordPolicyRelModel
50   * @see com.liferay.portal.service.model.impl.PasswordPolicyRelImpl
51   *
52   */
53  public class PasswordPolicyRelModelImpl extends BaseModelImpl {
54      public static String TABLE_NAME = "PasswordPolicyRel";
55      public static Object[][] TABLE_COLUMNS = {
56              { "passwordPolicyRelId", new Integer(Types.BIGINT) },
57              { "passwordPolicyId", new Integer(Types.BIGINT) },
58              { "classNameId", new Integer(Types.BIGINT) },
59              { "classPK", new Integer(Types.BIGINT) }
60          };
61      public static String TABLE_SQL_CREATE = "create table PasswordPolicyRel (passwordPolicyRelId LONG not null primary key,passwordPolicyId LONG,classNameId LONG,classPK LONG)";
62      public static String TABLE_SQL_DROP = "drop table PasswordPolicyRel";
63      public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
64                  "xss.allow.com.liferay.portal.model.PasswordPolicyRel"),
65              XSS_ALLOW);
66      public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
67                  "lock.expiration.time.com.liferay.portal.model.PasswordPolicyRelModel"));
68  
69      public PasswordPolicyRelModelImpl() {
70      }
71  
72      public long getPrimaryKey() {
73          return _passwordPolicyRelId;
74      }
75  
76      public void setPrimaryKey(long pk) {
77          setPasswordPolicyRelId(pk);
78      }
79  
80      public Serializable getPrimaryKeyObj() {
81          return new Long(_passwordPolicyRelId);
82      }
83  
84      public long getPasswordPolicyRelId() {
85          return _passwordPolicyRelId;
86      }
87  
88      public void setPasswordPolicyRelId(long passwordPolicyRelId) {
89          if (passwordPolicyRelId != _passwordPolicyRelId) {
90              _passwordPolicyRelId = passwordPolicyRelId;
91          }
92      }
93  
94      public long getPasswordPolicyId() {
95          return _passwordPolicyId;
96      }
97  
98      public void setPasswordPolicyId(long passwordPolicyId) {
99          if (passwordPolicyId != _passwordPolicyId) {
100             _passwordPolicyId = passwordPolicyId;
101         }
102     }
103 
104     public long getClassNameId() {
105         return _classNameId;
106     }
107 
108     public void setClassNameId(long classNameId) {
109         if (classNameId != _classNameId) {
110             _classNameId = classNameId;
111         }
112     }
113 
114     public long getClassPK() {
115         return _classPK;
116     }
117 
118     public void setClassPK(long classPK) {
119         if (classPK != _classPK) {
120             _classPK = classPK;
121         }
122     }
123 
124     public Object clone() {
125         PasswordPolicyRelImpl clone = new PasswordPolicyRelImpl();
126         clone.setPasswordPolicyRelId(getPasswordPolicyRelId());
127         clone.setPasswordPolicyId(getPasswordPolicyId());
128         clone.setClassNameId(getClassNameId());
129         clone.setClassPK(getClassPK());
130 
131         return clone;
132     }
133 
134     public int compareTo(Object obj) {
135         if (obj == null) {
136             return -1;
137         }
138 
139         PasswordPolicyRelImpl passwordPolicyRel = (PasswordPolicyRelImpl)obj;
140         long pk = passwordPolicyRel.getPrimaryKey();
141 
142         if (getPrimaryKey() < pk) {
143             return -1;
144         }
145         else if (getPrimaryKey() > pk) {
146             return 1;
147         }
148         else {
149             return 0;
150         }
151     }
152 
153     public boolean equals(Object obj) {
154         if (obj == null) {
155             return false;
156         }
157 
158         PasswordPolicyRelImpl passwordPolicyRel = null;
159 
160         try {
161             passwordPolicyRel = (PasswordPolicyRelImpl)obj;
162         }
163         catch (ClassCastException cce) {
164             return false;
165         }
166 
167         long pk = passwordPolicyRel.getPrimaryKey();
168 
169         if (getPrimaryKey() == pk) {
170             return true;
171         }
172         else {
173             return false;
174         }
175     }
176 
177     public int hashCode() {
178         return (int)getPrimaryKey();
179     }
180 
181     private long _passwordPolicyRelId;
182     private long _passwordPolicyId;
183     private long _classNameId;
184     private long _classPK;
185 }