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