java.lang.Object
org.tentackle.sql.metadata.ModelMetaData
The whole metadata for the connected database.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionModelMetaData(Backend backend, DatabaseMetaData[] metaData, String[] schemas) Creates a database meta instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddTableMetaData(TableMetaData tableMetaData) Adds a table to this model.
If schemas are set, only tables belonging to one of given schemas will be appended.Gets the header info of all tables in the database.Gets the backend.Gets the JDBC-connection's metadata.
May be more than one if different schemas and schema-option was given inBackendInfo.String[]Gets the valid schemas.getTableInDatabase(String tableName) Gets the header infos for given tablename.
May return more than one entry if the same tablename is used in more than one schema.Gets the tables of this model.toString()
-
Constructor Details
-
ModelMetaData
Creates a database meta instance.- Parameters:
backend- the backendmetaData- the connections metadataschemas- optional schemas, null if no schema check
-
-
Method Details
-
getAllTablesInDatabase
Gets the header info of all tables in the database.- Returns:
- the table headers
- Throws:
SQLException- if cannot retrieve meta data from database
-
getTableInDatabase
Gets the header infos for given tablename.
May return more than one entry if the same tablename is used in more than one schema.- Parameters:
tableName- the tablename- Returns:
- the non-empty list of header infos, null if no such table in database
- Throws:
SQLException- if cannot retrieve meta data from database
-
addTableMetaData
Adds a table to this model.
If schemas are set, only tables belonging to one of given schemas will be appended.- Parameters:
tableMetaData- the table- Returns:
- true if added, false if wrong schema
-
getTables
Gets the tables of this model.- Returns:
- the tables
-
getBackend
Gets the backend.- Returns:
- the backend
-
getSchemas
Gets the valid schemas.- Returns:
- the optional schemas, null if no schema check
-
getMetaData
Gets the JDBC-connection's metadata.
May be more than one if different schemas and schema-option was given inBackendInfo.- Returns:
- the meta data
-
toString
-