org.d2rq.db.schema
Class Inspector
java.lang.Object
org.d2rq.db.schema.Inspector
public class Inspector
- extends Object
Inspects a database to retrieve schema information.
This should be called through SQLConnection
when possible,
because that class caches results.
- Author:
- Richard Cyganiak (richard@cyganiak.de)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Inspector
public Inspector(Connection connection,
Vendor vendor)
getTableNames
public List<TableName> getTableNames(String searchInSchema)
- Lists available table names.
- Parameters:
searchInSchema
- Schema to list tables from; null to list tables from all schemas
- Returns:
- A list of table names
describeSelectStatement
public List<ColumnDef> describeSelectStatement(String sqlQuery)
describeTableOrView
public TableDef describeTableOrView(TableName table)
isReferencedByForeignKey
public boolean isReferencedByForeignKey(TableName table)
- Returns:
true
if another table has a foreign key referencing
this table's primary key
isZerofillColumn
public boolean isZerofillColumn(ColumnName column)
- TODO: Move vendor-specific zerofill stuff to vendor.MySQL class
TODO: This should be cached in
TableDef
and not called through ConnectedDB