01: /*
02: * DbObject.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.SQLException;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public interface DbObject {
21: String getCatalog();
22:
23: String getSchema();
24:
25: /**
26: * Returns the name of the object (e.g. TABLE, PROCEDURE, ...)
27: *
28: * @return the object's type
29: */
30: String getObjectType();
31:
32: /**
33: * Return the name of the object as it should be displayed to the end-user
34: * (without quoting or catalog/schema prefix).
35: *
36: * @return the object's name
37: */
38: String getObjectName();
39:
40: /**
41: * Return the name of the version to be used in SQL Statements.
42: * This will consider quoting of special characters if necessary.
43: *
44: * @param conn The connection for which the correct name should be returned
45: * @return the name of the object, quoted with respect to the passed connection
46: */
47: String getObjectName(WbConnection conn);
48:
49: /**
50: * Get a fully qualified name of the object.
51: *
52: * @param conn The connection for which the qualified name should be createdd
53: * @return the qualified name including catalog and schema if applicable
54: */
55: String getObjectExpression(WbConnection conn);
56:
57: /**
58: * Return the SQL source for this object. This is not necessariyl
59: * a valid SQL Statement that can be run (e.g. for a column definition)
60: * @param con the connection for which to create the source
61: * @return the course to re-create this object
62: * @throws java.sql.SQLException
63: */
64: CharSequence getSource(WbConnection con) throws SQLException;
65:
66: }
|