01: package net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint;
02:
03: /*
04: * Copyright (C) 2004 Ryan Walberg <generalpf@yahoo.com>
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20:
21: import java.util.ArrayList;
22:
23: public class ForeignKeyConstraint extends MssqlConstraint {
24:
25: private ArrayList<String> _primaryColumns;
26:
27: /**
28: * Holds value of property referencedTable.
29: */
30: private String _referencedTable;
31:
32: // the columns in the referenced table
33:
34: /** Creates a new instance of ForeignKeyConstraint */
35: public ForeignKeyConstraint() {
36: super ();
37: _primaryColumns = new ArrayList<String>();
38: }
39:
40: public void addPrimaryColumn(String columnName) {
41: _primaryColumns.add(columnName);
42: }
43:
44: public Object[] getPrimaryColumns() {
45: return _primaryColumns.toArray();
46: }
47:
48: /**
49: * Getter for property referencedTable.
50: * @return Value of property referencedTable.
51: */
52: public String getReferencedTable() {
53: return this ._referencedTable;
54: }
55:
56: /**
57: * Setter for property referencedTable.
58: * @param referencedTable New value of property referencedTable.
59: */
60: public void setReferencedTable(String referencedTable) {
61: this._referencedTable = referencedTable;
62: }
63:
64: }
|