001: /*
002: * HA-JDBC: High-Availability JDBC
003: * Copyright (c) 2004-2007 Paul Ferraro
004: *
005: * This library is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU Lesser General Public License as published by the
007: * Free Software Foundation; either version 2.1 of the License, or (at your
008: * option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful, but WITHOUT
011: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
012: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
013: * for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public License
016: * along with this library; if not, write to the Free Software Foundation,
017: * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * Contact: ferraro@users.sourceforge.net
020: */
021: package net.sf.hajdbc.cache;
022:
023: import java.util.LinkedList;
024: import java.util.List;
025:
026: import net.sf.hajdbc.ForeignKeyConstraint;
027:
028: /**
029: * @author Paul Ferraro
030: */
031: public class ForeignKeyConstraintImpl extends UniqueConstraintImpl
032: implements ForeignKeyConstraint {
033: private String foreignTable;
034: private List<String> foreignColumnList = new LinkedList<String>();
035: private int updateRule;
036: private int deleteRule;
037: private int deferrability;
038:
039: /**
040: * Constructs a new ForeignKey.
041: * @param name the name of this constraint
042: * @param table a schema qualified table name
043: */
044: public ForeignKeyConstraintImpl(String name, String table) {
045: super (name, table);
046: }
047:
048: /**
049: * @see net.sf.hajdbc.ForeignKeyConstraint#getForeignTable()
050: */
051: @Override
052: public String getForeignTable() {
053: return this .foreignTable;
054: }
055:
056: /**
057: * @see net.sf.hajdbc.ForeignKeyConstraint#getForeignColumnList()
058: */
059: @Override
060: public List<String> getForeignColumnList() {
061: return this .foreignColumnList;
062: }
063:
064: /**
065: * @see net.sf.hajdbc.ForeignKeyConstraint#getDeleteRule()
066: */
067: @Override
068: public int getDeleteRule() {
069: return this .deleteRule;
070: }
071:
072: /**
073: * @see net.sf.hajdbc.ForeignKeyConstraint#getUpdateRule()
074: */
075: @Override
076: public int getUpdateRule() {
077: return this .updateRule;
078: }
079:
080: /**
081: * @see net.sf.hajdbc.ForeignKeyConstraint#getDeferrability()
082: */
083: @Override
084: public int getDeferrability() {
085: return this .deferrability;
086: }
087:
088: /**
089: * @see net.sf.hajdbc.ForeignKeyConstraint#setDeferrability(int)
090: */
091: @Override
092: public void setDeferrability(int deferrability) {
093: this .deferrability = deferrability;
094: }
095:
096: /**
097: * @see net.sf.hajdbc.ForeignKeyConstraint#setDeleteRule(int)
098: */
099: @Override
100: public void setDeleteRule(int deleteRule) {
101: this .deleteRule = deleteRule;
102: }
103:
104: /**
105: * @see net.sf.hajdbc.ForeignKeyConstraint#setForeignTable(java.lang.String)
106: */
107: @Override
108: public void setForeignTable(String foreignTable) {
109: this .foreignTable = foreignTable;
110: }
111:
112: /**
113: * @see net.sf.hajdbc.ForeignKeyConstraint#setUpdateRule(int)
114: */
115: @Override
116: public void setUpdateRule(int updateRule) {
117: this.updateRule = updateRule;
118: }
119: }
|