01: package net.sourceforge.squirrel_sql.fw.sql;
02:
03: /*
04: * Copyright (C) 2001-2002 Colin Bell
05: * colbell@users.sourceforge.net
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: */
21:
22: public class UDTInfo extends DatabaseObjectInfo implements IUDTInfo {
23: static final long serialVersionUID = 8215062701260471438L;
24:
25: /** Java class name. */
26: private final String _javaClassName;
27:
28: /** UDT Data Type. */
29: private final String _dataType;
30:
31: /** UDT remarks. */
32: private final String _remarks;
33:
34: UDTInfo(String catalog, String schema, String simpleName,
35: String javaClassName, String dataType, String remarks,
36: SQLDatabaseMetaData md) {
37: super (catalog, schema, simpleName, DatabaseObjectType.UDT, md);
38: _javaClassName = javaClassName;
39: _dataType = dataType;
40: _remarks = remarks;
41: }
42:
43: public String getJavaClassName() {
44: return _javaClassName;
45: }
46:
47: public String getDataType() {
48: return _dataType;
49: }
50:
51: public String getRemarks() {
52: return _remarks;
53: }
54:
55: public boolean equals(Object obj) {
56: if (super .equals(obj) && obj instanceof UDTInfo) {
57: UDTInfo info = (UDTInfo) obj;
58: if ((info._dataType == null && _dataType == null)
59: || ((info._dataType != null && _dataType != null) && info._dataType
60: .equals(_dataType))) {
61: if ((info._javaClassName == null && _javaClassName == null)
62: || ((info._javaClassName != null && _javaClassName != null) && info._javaClassName
63: .equals(_javaClassName))) {
64: return ((info._remarks == null && _remarks == null) || ((info._remarks != null && _remarks != null) && info._remarks
65: .equals(_remarks)));
66: }
67: }
68: }
69: return false;
70: }
71: }
|