- java.lang.Object
-
- org.tentackle.sql.metadata.ModelMetaData
-
public class ModelMetaData extends java.lang.ObjectThe whole metadata for the connected database.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description ModelMetaData(Backend backend, java.sql.DatabaseMetaData[] metaData, java.lang.String[] schemas)Creates a database meta instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddTableMetaData(TableMetaData tableMetaData)Adds a table to this model.
If schemas are set, only tables belonging to one of given schemas will be appended.BackendgetBackend()Gets the backend.java.sql.DatabaseMetaData[]getMetaData()Gets the JDBC-connection's meta data.
May be more than one if different schemas and schema-option was given inBackendInfo.java.util.PropertiesgetProperties()Gets the migration properties.
Used to remember settings of the migration process.java.lang.String[]getSchemas()Gets the valid schemas.java.util.Collection<TableMetaData>getTables()Gets the tables of this model.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ModelMetaData
public ModelMetaData(Backend backend, java.sql.DatabaseMetaData[] metaData, java.lang.String[] schemas)
Creates a database meta instance.- Parameters:
backend- the backendmetaData- the connections meta dataschemas- optional schemas, null if no schema check
-
-
Method Detail
-
getProperties
public java.util.Properties getProperties()
Gets the migration properties.
Used to remember settings of the migration process.- Returns:
- the properties
-
addTableMetaData
public boolean addTableMetaData(TableMetaData tableMetaData)
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
public java.util.Collection<TableMetaData> getTables()
Gets the tables of this model.- Returns:
- the tables
-
getBackend
public Backend getBackend()
Gets the backend.- Returns:
- the backend
-
getSchemas
public java.lang.String[] getSchemas()
Gets the valid schemas.- Returns:
- the optional schemas, null if no schema check
-
getMetaData
public java.sql.DatabaseMetaData[] getMetaData()
Gets the JDBC-connection's meta data.
May be more than one if different schemas and schema-option was given inBackendInfo.- Returns:
- the meta data
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-