1
22
23 package com.liferay.portal.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 ClassNameModelImpl extends BaseModelImpl {
56 public static String TABLE_NAME = "ClassName_";
57 public static Object[][] TABLE_COLUMNS = {
58 { "classNameId", new Integer(Types.BIGINT) },
59 { "value", new Integer(Types.VARCHAR) }
60 };
61 public static String TABLE_SQL_CREATE = "create table ClassName_ (classNameId LONG not null primary key,value VARCHAR(200) null)";
62 public static String TABLE_SQL_DROP = "drop table ClassName_";
63 public static boolean XSS_ALLOW_BY_MODEL = GetterUtil.getBoolean(PropsUtil.get(
64 "xss.allow.com.liferay.portal.model.ClassName"), XSS_ALLOW);
65 public static boolean XSS_ALLOW_VALUE = GetterUtil.getBoolean(PropsUtil.get(
66 "xss.allow.com.liferay.portal.model.ClassName.value"),
67 XSS_ALLOW_BY_MODEL);
68 public static long LOCK_EXPIRATION_TIME = GetterUtil.getLong(PropsUtil.get(
69 "lock.expiration.time.com.liferay.portal.model.ClassNameModel"));
70
71 public ClassNameModelImpl() {
72 }
73
74 public long getPrimaryKey() {
75 return _classNameId;
76 }
77
78 public void setPrimaryKey(long pk) {
79 setClassNameId(pk);
80 }
81
82 public Serializable getPrimaryKeyObj() {
83 return new Long(_classNameId);
84 }
85
86 public long getClassNameId() {
87 return _classNameId;
88 }
89
90 public void setClassNameId(long classNameId) {
91 if (classNameId != _classNameId) {
92 _classNameId = classNameId;
93 }
94 }
95
96 public String getValue() {
97 return GetterUtil.getString(_value);
98 }
99
100 public void setValue(String value) {
101 if (((value == null) && (_value != null)) ||
102 ((value != null) && (_value == null)) ||
103 ((value != null) && (_value != null) && !value.equals(_value))) {
104 if (!XSS_ALLOW_VALUE) {
105 value = XSSUtil.strip(value);
106 }
107
108 _value = value;
109 }
110 }
111
112 public Object clone() {
113 ClassNameImpl clone = new ClassNameImpl();
114 clone.setClassNameId(getClassNameId());
115 clone.setValue(getValue());
116
117 return clone;
118 }
119
120 public int compareTo(Object obj) {
121 if (obj == null) {
122 return -1;
123 }
124
125 ClassNameImpl className = (ClassNameImpl)obj;
126 long pk = className.getPrimaryKey();
127
128 if (getPrimaryKey() < pk) {
129 return -1;
130 }
131 else if (getPrimaryKey() > pk) {
132 return 1;
133 }
134 else {
135 return 0;
136 }
137 }
138
139 public boolean equals(Object obj) {
140 if (obj == null) {
141 return false;
142 }
143
144 ClassNameImpl className = null;
145
146 try {
147 className = (ClassNameImpl)obj;
148 }
149 catch (ClassCastException cce) {
150 return false;
151 }
152
153 long pk = className.getPrimaryKey();
154
155 if (getPrimaryKey() == pk) {
156 return true;
157 }
158 else {
159 return false;
160 }
161 }
162
163 public int hashCode() {
164 return (int)getPrimaryKey();
165 }
166
167 private long _classNameId;
168 private String _value;
169 }