1
22
23 package com.liferay.portlet.wiki.model.impl;
24
25 import com.liferay.portal.kernel.util.GetterUtil;
26 import com.liferay.portal.model.impl.BaseModelImpl;
27 import com.liferay.portal.util.PropsUtil;
28
29 import com.liferay.util.XSSUtil;
30
31 import java.io.Serializable;
32
33 import java.sql.Types;
34
35
55 public class WikiPageResourceModelImpl extends BaseModelImpl {
56 public static String TABLE_NAME = "WikiPageResource";
57 public static Object[][] TABLE_COLUMNS = {
58 { "resourcePrimKey", new Integer(Types.BIGINT) },
59 { "nodeId", new Integer(Types.BIGINT) },
60 { "title", new Integer(Types.VARCHAR) }
61 };
62 public static String TABLE_SQL_CREATE = "create table WikiPageResource (resourcePrimKey LONG not null primary key,nodeId LONG,title VARCHAR(75) null)";
63 public static String TABLE_SQL_DROP = "drop table WikiPageResource";
64 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
65 "xss.allow.com.liferay.portlet.wiki.model.WikiPageResource"),
66 XSS_ALLOW);
67 public static boolean XSS_ALLOW_TITLE = GetterUtil.getBoolean(PropsUtil.get(
68 "xss.allow.com.liferay.portlet.wiki.model.WikiPageResource.title"),
69 XSS_ALLOW_BY_MODEL);
70 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
71 "lock.expiration.time.com.liferay.portlet.wiki.model.WikiPageResourceModel"));
72
73 public WikiPageResourceModelImpl() {
74 }
75
76 public long getPrimaryKey() {
77 return _resourcePrimKey;
78 }
79
80 public void setPrimaryKey(long pk) {
81 setResourcePrimKey(pk);
82 }
83
84 public Serializable getPrimaryKeyObj() {
85 return new Long(_resourcePrimKey);
86 }
87
88 public long getResourcePrimKey() {
89 return _resourcePrimKey;
90 }
91
92 public void setResourcePrimKey(long resourcePrimKey) {
93 if (resourcePrimKey != _resourcePrimKey) {
94 _resourcePrimKey = resourcePrimKey;
95 }
96 }
97
98 public long getNodeId() {
99 return _nodeId;
100 }
101
102 public void setNodeId(long nodeId) {
103 if (nodeId != _nodeId) {
104 _nodeId = nodeId;
105 }
106 }
107
108 public String getTitle() {
109 return GetterUtil.getString(_title);
110 }
111
112 public void setTitle(String title) {
113 if (((title == null) && (_title != null)) ||
114 ((title != null) && (_title == null)) ||
115 ((title != null) && (_title != null) && !title.equals(_title))) {
116 if (!XSS_ALLOW_TITLE) {
117 title = XSSUtil.strip(title);
118 }
119
120 _title = title;
121 }
122 }
123
124 public Object clone() {
125 WikiPageResourceImpl clone = new WikiPageResourceImpl();
126 clone.setResourcePrimKey(getResourcePrimKey());
127 clone.setNodeId(getNodeId());
128 clone.setTitle(getTitle());
129
130 return clone;
131 }
132
133 public int compareTo(Object obj) {
134 if (obj == null) {
135 return -1;
136 }
137
138 WikiPageResourceImpl wikiPageResource = (WikiPageResourceImpl)obj;
139 long pk = wikiPageResource.getPrimaryKey();
140
141 if (getPrimaryKey() < pk) {
142 return -1;
143 }
144 else if (getPrimaryKey() > pk) {
145 return 1;
146 }
147 else {
148 return 0;
149 }
150 }
151
152 public boolean equals(Object obj) {
153 if (obj == null) {
154 return false;
155 }
156
157 WikiPageResourceImpl wikiPageResource = null;
158
159 try {
160 wikiPageResource = (WikiPageResourceImpl)obj;
161 }
162 catch (ClassCastException cce) {
163 return false;
164 }
165
166 long pk = wikiPageResource.getPrimaryKey();
167
168 if (getPrimaryKey() == pk) {
169 return true;
170 }
171 else {
172 return false;
173 }
174 }
175
176 public int hashCode() {
177 return (int)getPrimaryKey();
178 }
179
180 private long _resourcePrimKey;
181 private long _nodeId;
182 private String _title;
183 }