01: /*
02: * H2ConstraintReader.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.h2database;
13:
14: import workbench.db.AbstractConstraintReader;
15:
16: /**
17: * Constraint reader for HSQLDB
18: * @author support@sql-workbench.net
19: */
20: public class H2ConstraintReader extends AbstractConstraintReader {
21: private final String TABLE_SQL = "select column_name, 'CHECK '||check_constraint \n"
22: + "from information_schema.columns \n"
23: + "where table_name = ? \n"
24: + "and table_schema = ? \n"
25: + "and check_constraint is not null";
26:
27: public H2ConstraintReader() {
28: }
29:
30: public int getIndexForSchemaParameter() {
31: return 2;
32: }
33:
34: public int getIndexForTableNameParameter() {
35: return 1;
36: }
37:
38: public String getColumnConstraintSql() {
39: return this .TABLE_SQL;
40: }
41:
42: public String getTableConstraintSql() {
43: return null;
44: }
45:
46: }
|