org.eclipse.jpt.db
Interface Database

All Superinterfaces:
java.lang.Comparable<Database>, DatabaseObject, SchemaContainer

public interface Database
extends SchemaContainer, java.lang.Comparable<Database>

Database Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. This interface is not intended to be implemented by clients.


Method Summary
 java.util.Iterator<Catalog> catalogs()
          Return the database's catalogs.
 int catalogsSize()
          Return the number of catalogs the database contains.
 java.lang.String convertNameToIdentifier(java.lang.String name)
          Convert the specified name to a database-appropriate SQL identifier.
 Catalog getCatalogForIdentifier(java.lang.String identifier)
          Return the catalog for the specified identifier.
 Catalog getCatalogNamed(java.lang.String name)
          Return the catalog with specified name.
 Catalog getDefaultCatalog()
          Return the database's "default" catalog.
 java.lang.String getVendorName()
          Return the name of the database's vendor.
 java.lang.String getVersion()
          Return the database's version.
<T extends DatabaseObject>
T
selectDatabaseObjectForIdentifier(T[] databaseObjects, java.lang.String identifier)
          Select and return from the specified list of database objects the database object identified by the specified identifier.
 java.util.Iterator<java.lang.String> sortedCatalogIdentifiers()
          Return the database's catalog identifiers, sorted by name.
 boolean supportsCatalogs()
          Return whether the database supports catalogs.
 
Methods inherited from interface org.eclipse.jpt.db.SchemaContainer
getDefaultSchema, getSchemaForIdentifier, getSchemaNamed, schemata, schemataSize, sortedSchemaIdentifiers
 
Methods inherited from interface org.eclipse.jpt.db.DatabaseObject
getConnectionProfile, getDatabase, getIdentifier, getIdentifier, getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getVendorName

java.lang.String getVendorName()
Return the name of the database's vendor.


getVersion

java.lang.String getVersion()
Return the database's version.


supportsCatalogs

boolean supportsCatalogs()
Return whether the database supports catalogs. If it does, all database objects are contained by the database's catalogs; otherwise all database objects are contained by the database's schemata. Practically speaking: if #supportsCatalogs() returns 'true' #catalogs() returns catalogs that contain the database's schemata #schemata() returns an empty iterator else #catalogs() returns an empty iterator #schemata() returns the database's schemata This is complicated by the presence of a "default" catalog that clients can use to allow the specification of a catalog to be optional; but clients must manage this explicitly.

See Also:
catalogs(), SchemaContainer.schemata()

catalogs

java.util.Iterator<Catalog> catalogs()
Return the database's catalogs. Return an empty iterator if the database does not support catalogs.

See Also:
supportsCatalogs()

catalogsSize

int catalogsSize()
Return the number of catalogs the database contains. Return zero if the database does not support catalogs.

See Also:
supportsCatalogs()

getCatalogNamed

Catalog getCatalogNamed(java.lang.String name)
Return the catalog with specified name. The name must be an exact match of the catalog's name. Return null if the database does not support catalogs.

See Also:
supportsCatalogs(), getCatalogForIdentifier(String)

sortedCatalogIdentifiers

java.util.Iterator<java.lang.String> sortedCatalogIdentifiers()
Return the database's catalog identifiers, sorted by name. Return an empty iterator if the database does not support catalogs.


getCatalogForIdentifier

Catalog getCatalogForIdentifier(java.lang.String identifier)
Return the catalog for the specified identifier. The identifier should be an SQL identifier (i.e. quoted when case-sensitive or containing special characters, unquoted otherwise). Return null if the database does not support catalogs.

See Also:
supportsCatalogs(), getCatalogNamed(String)

getDefaultCatalog

Catalog getDefaultCatalog()
Return the database's "default" catalog. Return null if the database does not support catalogs.

See Also:
supportsCatalogs()

selectDatabaseObjectForIdentifier

<T extends DatabaseObject> T selectDatabaseObjectForIdentifier(T[] databaseObjects,
                                                               java.lang.String identifier)
Select and return from the specified list of database objects the database object identified by the specified identifier. The identifier should be an SQL identifier (i.e. delimited when non-"normal").


convertNameToIdentifier

java.lang.String convertNameToIdentifier(java.lang.String name)
Convert the specified name to a database-appropriate SQL identifier.