[#1097] Add org.jooq.Catalog, a type modelling an entity combining

several org.jooq.Schema
This commit is contained in:
Lukas Eder 2012-12-20 16:51:13 +01:00
parent b7016bd581
commit 102f6065f6
2 changed files with 18 additions and 3 deletions

View File

@ -64,22 +64,32 @@ public interface Meta {
/**
* Get all catalog objects from the underlying {@link DatabaseMetaData}
* <p>
* For those databases that don't really support JDBC meta data catalogs, a
* single empty catalog (named <code>""</code>) will be returned. In other
* words, there is always at least one catalog in a database.
*
* @throws DataAccessException If something went wrong fetching the meta objects
* @throws DataAccessException If something went wrong fetching the meta
* objects
*/
@Support
List<Catalog> getCatalogs() throws DataAccessException;
/**
* Get all schema objects from the underlying {@link DatabaseMetaData}
*
* @throws DataAccessException If something went wrong fetching the meta objects
* @throws DataAccessException If something went wrong fetching the meta
* objects
*/
@Support
List<Schema> getSchemas() throws DataAccessException;
/**
* Get all table objects from the underlying {@link DatabaseMetaData}
*
* @throws DataAccessException If something went wrong fetching the meta objects
* @throws DataAccessException If something went wrong fetching the meta
* objects
*/
@Support
List<Table<?>> getTables() throws DataAccessException;
}

View File

@ -92,6 +92,11 @@ class MetaImpl implements Meta {
result.add(new MetaCatalog(name));
}
// There should always be at least one (empty) catalog in a database
if (result.isEmpty()) {
result.add(new MetaCatalog(""));
}
return result;
}
catch (SQLException e) {