[#1097] Add org.jooq.Catalog, a type modelling an entity combining
several org.jooq.Schema
This commit is contained in:
parent
b7016bd581
commit
102f6065f6
@ -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;
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user