01: /*
02: * ConstraintReader.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;
13:
14: import java.sql.Connection;
15: import java.sql.SQLException;
16: import java.util.Map;
17:
18: /**
19: * @author support@sql-workbench.net
20: */
21: public interface ConstraintReader {
22: /**
23: * Returns the column constraints for the given table. The key to the Map is
24: * the column name, the value is the full expression which can be appended
25: * to the column definition inside a CREATE TABLE statement.
26: */
27: Map<String, String> getColumnConstraints(Connection dbConnection,
28: TableIdentifier aTable);
29:
30: /**
31: * Returns the SQL Statement that should be appended to a CREATE table
32: * in order to create the constraints defined on the table
33: */
34: String getTableConstraints(Connection dbConnection,
35: TableIdentifier aTable, String indent) throws SQLException;
36:
37: }
|