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