01: package net.sourceforge.squirrel_sql.fw.sql.dbobj;
02:
03: /*
04: * Copyright (C) 2004 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: import net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectInfo;
22: import net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectType;
23: import net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData;
24:
25: /**
26: * Describes one column in a set of columns that uniquely identifies a row in
27: * a table.
28: *
29: * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
30: */
31: public class BestRowIdentifier extends DatabaseObjectInfo {
32: static final long serialVersionUID = 7587093034289367642L;
33:
34: final private int _scope;
35: final private String _colName;
36: final private short _sqlDataType;
37: final private String _typeName;
38: final private int _precision;
39: final private short _scale;
40: final private short _pseudoColumn;
41:
42: /**
43: * Ctor specifying attributes.
44: */
45: public BestRowIdentifier(String catalog, String schema,
46: String tableName, int scope, String colName,
47: short sqlDataType, String typeName, int precision,
48: short scale, short pseudoColumn, SQLDatabaseMetaData md) {
49: super (catalog, schema, tableName,
50: DatabaseObjectType.FOREIGN_KEY, md);
51:
52: _scope = scope;
53: _colName = colName;
54: _sqlDataType = sqlDataType;
55: _typeName = typeName;
56: _precision = precision;
57: _scale = scale;
58: _pseudoColumn = pseudoColumn;
59: }
60:
61: public int getScope() {
62: return _scope;
63: }
64:
65: public String getColumnName() {
66: return _colName;
67: }
68:
69: public short getSQLDataType() {
70: return _sqlDataType;
71: }
72:
73: public String getTypeName() {
74: return _typeName;
75: }
76:
77: public int getPrecision() {
78: return _precision;
79: }
80:
81: public short getScale() {
82: return _scale;
83: }
84:
85: public short getPseudoColumn() {
86: return _pseudoColumn;
87: }
88: }
|