01: /*
02: * FirebirdConstraintReader.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.db.firebird;
13:
14: import workbench.db.AbstractConstraintReader;
15:
16: /**
17: * An implementation of {@link AbstractConstraintReader} for the
18: * <a href="http://www.firebirdsql.org">Firebird</a> database server
19: * @author support@sql-workbench.net
20: */
21: public class FirebirdConstraintReader extends AbstractConstraintReader {
22:
23: // private static final String COL_SQL="select f.rdb$field_name,rdb$trigger_source \n" +
24: // "from rdb$relation_constraints rc, \n" +
25: // " rdb$check_constraints cc, \n" +
26: // " rdb$triggers trg, \n" +
27: // " rdb$dependencies dep, \n" +
28: // " rdb$relation_fields f \n" +
29: // "where rc.rdb$relation_name = ? \n" +
30: // "and rc.rdb$constraint_type = 'CHECK' \n" +
31: // "and rc.rdb$constraint_name = cc.rdb$constraint_name \n" +
32: // "and cc.rdb$trigger_name = trg.rdb$trigger_name \n" +
33: // "and dep.rdb$depended_on_name = rc.rdb$relation_name \n" +
34: // "and dep.rdb$field_name = f.rdb$field_name \n" +
35: // "and dep.rdb$dependent_name = trg.rdb$trigger_name \n" +
36: // "and f.rdb$relation_name = rc.rdb$relation_name \n" +
37: // "and trg.rdb$trigger_type = 1 \n";
38:
39: private static final String TABLE_SQL = "select rdb$trigger_source \n"
40: + "from rdb$relation_constraints rc, \n"
41: + " rdb$check_constraints cc, \n"
42: + " rdb$triggers trg \n"
43: + "where rc.rdb$relation_name = ? \n"
44: + "and rc.rdb$constraint_type = 'CHECK' \n"
45: + "and rc.rdb$constraint_name = cc.rdb$constraint_name \n"
46: + "and cc.rdb$trigger_name = trg.rdb$trigger_name \n"
47: + "and trg.rdb$trigger_type = 1 \n";
48:
49: /** Creates a new instance of FirebirdColumnConstraintReader */
50: public FirebirdConstraintReader() {
51: }
52:
53: public String getColumnConstraintSql() {
54: return null;
55: }
56:
57: public String getTableConstraintSql() {
58: return TABLE_SQL;
59: }
60: }
|