Class OracleMetaDataProvider
- java.lang.Object
-
- org.alfasoftware.morf.jdbc.oracle.OracleMetaDataProvider
-
- All Implemented Interfaces:
org.alfasoftware.morf.metadata.Schema
public class OracleMetaDataProvider extends java.lang.Object implements org.alfasoftware.morf.metadata.SchemaOracle-specific meta data provision for databases.- Author:
- Copyright (c) Alfa Financial Software 2010
-
-
Constructor Summary
Constructors Constructor Description OracleMetaDataProvider(java.sql.Connection connection, java.lang.String schemaName)Construct a new meta data provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.alfasoftware.morf.metadata.TablegetTable(java.lang.String name)org.alfasoftware.morf.metadata.ViewgetView(java.lang.String name)booleanisEmptyDatabase()Reading all the table metadata is slow on Oracle, so we can optimise the empty database check by just seeing if there are any tables.booleantableExists(java.lang.String name)java.util.Collection<java.lang.String>tableNames()java.util.Collection<org.alfasoftware.morf.metadata.Table>tables()booleanviewExists(java.lang.String name)java.util.Collection<java.lang.String>viewNames()java.util.Collection<org.alfasoftware.morf.metadata.View>views()
-
-
-
Constructor Detail
-
OracleMetaDataProvider
public OracleMetaDataProvider(java.sql.Connection connection, java.lang.String schemaName)Construct a new meta data provider.Converts the schema name to upper case, otherwise the provider cannot connect to it.
- Parameters:
connection- Connection details.schemaName- Schema name.
-
-
Method Detail
-
isEmptyDatabase
public boolean isEmptyDatabase()
Reading all the table metadata is slow on Oracle, so we can optimise the empty database check by just seeing if there are any tables.- Specified by:
isEmptyDatabasein interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
DatabaseMetaDataProvider.isEmptyDatabase()
-
tableExists
public boolean tableExists(java.lang.String name)
- Specified by:
tableExistsin interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.tableExists(java.lang.String)
-
getTable
public org.alfasoftware.morf.metadata.Table getTable(java.lang.String name)
The
Tableimplementation returned may containColumnimplementations which evaluate the metadata elements (ColumnType.getType(),ColumnType.getWidth()etc.) lazily. If the database column type is not supported, this may throw anDatabaseMetaDataProvider.UnexpectedDataTypeExceptionwhen evaluated. This allows tables with unsupported data types to be enumerated (and thus co-exist in the database schema) but not be supported by the application.- Specified by:
getTablein interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.getTable(java.lang.String)
-
tableNames
public java.util.Collection<java.lang.String> tableNames()
- Specified by:
tableNamesin interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.tableNames()
-
tables
public java.util.Collection<org.alfasoftware.morf.metadata.Table> tables()
The
Tableimplementation returned may containColumnimplementations which evaluate the metadata elements (ColumnType.getType(),ColumnType.getWidth()etc.) lazily. If the database column type is not supported, this may throw anDatabaseMetaDataProvider.UnexpectedDataTypeExceptionwhen evaluated. This allows tables with unsupported data types to be enumerated (and thus co-exist in the database schema) but not be supported by the application.- Specified by:
tablesin interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.tables()
-
viewExists
public boolean viewExists(java.lang.String name)
- Specified by:
viewExistsin interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.viewExists(java.lang.String)
-
getView
public org.alfasoftware.morf.metadata.View getView(java.lang.String name)
- Specified by:
getViewin interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.getView(java.lang.String)
-
viewNames
public java.util.Collection<java.lang.String> viewNames()
- Specified by:
viewNamesin interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.viewNames()
-
views
public java.util.Collection<org.alfasoftware.morf.metadata.View> views()
- Specified by:
viewsin interfaceorg.alfasoftware.morf.metadata.Schema- See Also:
Schema.views()
-
-