1
22
23 package com.liferay.portal.model.impl;
24
25 import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26 import com.liferay.portal.kernel.util.GetterUtil;
27 import com.liferay.portal.model.PasswordPolicyRel;
28 import com.liferay.portal.model.PasswordPolicyRelSoap;
29 import com.liferay.portal.util.PortalUtil;
30 import com.liferay.portal.util.PropsUtil;
31
32 import java.io.Serializable;
33
34 import java.lang.reflect.Proxy;
35
36 import java.sql.Types;
37
38 import java.util.ArrayList;
39 import java.util.List;
40
41
61 public class PasswordPolicyRelModelImpl extends BaseModelImpl {
62 public static final String TABLE_NAME = "PasswordPolicyRel";
63 public static final Object[][] TABLE_COLUMNS = {
64 { "passwordPolicyRelId", new Integer(Types.BIGINT) },
65
66
67 { "passwordPolicyId", new Integer(Types.BIGINT) },
68
69
70 { "classNameId", new Integer(Types.BIGINT) },
71
72
73 { "classPK", new Integer(Types.BIGINT) }
74 };
75 public static final String TABLE_SQL_CREATE = "create table PasswordPolicyRel (passwordPolicyRelId LONG not null primary key,passwordPolicyId LONG,classNameId LONG,classPK LONG)";
76 public static final String TABLE_SQL_DROP = "drop table PasswordPolicyRel";
77 public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(PropsUtil.get(
78 "value.object.finder.cache.enabled.com.liferay.portal.model.PasswordPolicyRel"),
79 true);
80
81 public static PasswordPolicyRel toModel(PasswordPolicyRelSoap soapModel) {
82 PasswordPolicyRel model = new PasswordPolicyRelImpl();
83
84 model.setPasswordPolicyRelId(soapModel.getPasswordPolicyRelId());
85 model.setPasswordPolicyId(soapModel.getPasswordPolicyId());
86 model.setClassNameId(soapModel.getClassNameId());
87 model.setClassPK(soapModel.getClassPK());
88
89 return model;
90 }
91
92 public static List<PasswordPolicyRel> toModels(
93 PasswordPolicyRelSoap[] soapModels) {
94 List<PasswordPolicyRel> models = new ArrayList<PasswordPolicyRel>(soapModels.length);
95
96 for (PasswordPolicyRelSoap soapModel : soapModels) {
97 models.add(toModel(soapModel));
98 }
99
100 return models;
101 }
102
103 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
104 "lock.expiration.time.com.liferay.portal.model.PasswordPolicyRel"));
105
106 public PasswordPolicyRelModelImpl() {
107 }
108
109 public long getPrimaryKey() {
110 return _passwordPolicyRelId;
111 }
112
113 public void setPrimaryKey(long pk) {
114 setPasswordPolicyRelId(pk);
115 }
116
117 public Serializable getPrimaryKeyObj() {
118 return new Long(_passwordPolicyRelId);
119 }
120
121 public long getPasswordPolicyRelId() {
122 return _passwordPolicyRelId;
123 }
124
125 public void setPasswordPolicyRelId(long passwordPolicyRelId) {
126 if (passwordPolicyRelId != _passwordPolicyRelId) {
127 _passwordPolicyRelId = passwordPolicyRelId;
128 }
129 }
130
131 public long getPasswordPolicyId() {
132 return _passwordPolicyId;
133 }
134
135 public void setPasswordPolicyId(long passwordPolicyId) {
136 if (passwordPolicyId != _passwordPolicyId) {
137 _passwordPolicyId = passwordPolicyId;
138 }
139 }
140
141 public String getClassName() {
142 return PortalUtil.getClassName(getClassNameId());
143 }
144
145 public long getClassNameId() {
146 return _classNameId;
147 }
148
149 public void setClassNameId(long classNameId) {
150 if (classNameId != _classNameId) {
151 _classNameId = classNameId;
152 }
153 }
154
155 public long getClassPK() {
156 return _classPK;
157 }
158
159 public void setClassPK(long classPK) {
160 if (classPK != _classPK) {
161 _classPK = classPK;
162 }
163 }
164
165 public PasswordPolicyRel toEscapedModel() {
166 if (isEscapedModel()) {
167 return (PasswordPolicyRel)this;
168 }
169 else {
170 PasswordPolicyRel model = new PasswordPolicyRelImpl();
171
172 model.setEscapedModel(true);
173
174 model.setPasswordPolicyRelId(getPasswordPolicyRelId());
175 model.setPasswordPolicyId(getPasswordPolicyId());
176 model.setClassNameId(getClassNameId());
177 model.setClassPK(getClassPK());
178
179 model = (PasswordPolicyRel)Proxy.newProxyInstance(PasswordPolicyRel.class.getClassLoader(),
180 new Class[] { PasswordPolicyRel.class },
181 new ReadOnlyBeanHandler(model));
182
183 return model;
184 }
185 }
186
187 public Object clone() {
188 PasswordPolicyRelImpl clone = new PasswordPolicyRelImpl();
189
190 clone.setPasswordPolicyRelId(getPasswordPolicyRelId());
191 clone.setPasswordPolicyId(getPasswordPolicyId());
192 clone.setClassNameId(getClassNameId());
193 clone.setClassPK(getClassPK());
194
195 return clone;
196 }
197
198 public int compareTo(Object obj) {
199 if (obj == null) {
200 return -1;
201 }
202
203 PasswordPolicyRelImpl passwordPolicyRel = (PasswordPolicyRelImpl)obj;
204
205 long pk = passwordPolicyRel.getPrimaryKey();
206
207 if (getPrimaryKey() < pk) {
208 return -1;
209 }
210 else if (getPrimaryKey() > pk) {
211 return 1;
212 }
213 else {
214 return 0;
215 }
216 }
217
218 public boolean equals(Object obj) {
219 if (obj == null) {
220 return false;
221 }
222
223 PasswordPolicyRelImpl passwordPolicyRel = null;
224
225 try {
226 passwordPolicyRel = (PasswordPolicyRelImpl)obj;
227 }
228 catch (ClassCastException cce) {
229 return false;
230 }
231
232 long pk = passwordPolicyRel.getPrimaryKey();
233
234 if (getPrimaryKey() == pk) {
235 return true;
236 }
237 else {
238 return false;
239 }
240 }
241
242 public int hashCode() {
243 return (int)getPrimaryKey();
244 }
245
246 private long _passwordPolicyRelId;
247 private long _passwordPolicyId;
248 private long _classNameId;
249 private long _classPK;
250 }