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