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