Java Code Examples for org.hibernate.boot.model.relational.Namespace#Name

The following examples show how to use org.hibernate.boot.model.relational.Namespace#Name . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DatabaseInformationImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public DatabaseInformationImpl(
		ServiceRegistry serviceRegistry,
		JdbcEnvironment jdbcEnvironment,
		DdlTransactionIsolator ddlTransactionIsolator,
		Namespace.Name defaultNamespace) throws SQLException {
	this.jdbcEnvironment = jdbcEnvironment;

	this.extractionContext = new ImprovedExtractionContextImpl(
			serviceRegistry,
			jdbcEnvironment,
			ddlTransactionIsolator,
			defaultNamespace.getCatalog(),
			defaultNamespace.getSchema(),
			this
	);

	// todo : make this pluggable
	this.extractor = new InformationExtractorJdbcDatabaseMetaDataImpl( extractionContext );

	// because we do not have defined a way to locate sequence info by name
	initializeSequences();
}
 
Example 2
Source File: Helper.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public static DatabaseInformation buildDatabaseInformation(
		ServiceRegistry serviceRegistry,
		DdlTransactionIsolator ddlTransactionIsolator,
		Namespace.Name defaultNamespace) {
	final JdbcEnvironment jdbcEnvironment = serviceRegistry.getService( JdbcEnvironment.class );
	try {
		return new DatabaseInformationImpl(
				serviceRegistry,
				jdbcEnvironment,
				ddlTransactionIsolator,
				defaultNamespace
		);
	}
	catch (SQLException e) {
		throw jdbcEnvironment.getSqlExceptionHelper().convert( e, "Unable to build DatabaseInformation" );
	}
}
 
Example 3
Source File: DatabaseInformationImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean schemaExists(Namespace.Name namespace) {
	return extractor.schemaExists( namespace.getCatalog(), namespace.getSchema() );
}
 
Example 4
Source File: DatabaseInformationImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public TableInformation getTableInformation(
		Namespace.Name namespace,
		Identifier tableName) {
	return getTableInformation( new QualifiedTableName( namespace, tableName ) );
}
 
Example 5
Source File: DatabaseInformationImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SequenceInformation getSequenceInformation(Namespace.Name schemaName, Identifier sequenceName) {
	return getSequenceInformation( new QualifiedSequenceName( schemaName, sequenceName ) );
}
 
Example 6
Source File: DatabaseInformation.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Check to see if the given schema already exists.
 *
 * @param schema The schema name
 *
 * @return {@code true} indicates a schema with the given name already exists
 */
boolean schemaExists(Namespace.Name schema);
 
Example 7
Source File: DatabaseInformation.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Obtain reference to the named TableInformation
 *
 * @param schemaName The name of the schema the table belongs to
 * @param tableName The table name
 *
 * @return The table information.  May return {@code null} if not found.
 */
TableInformation getTableInformation(Namespace.Name schemaName, Identifier tableName);
 
Example 8
Source File: DatabaseInformation.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Obtain reference to the named SequenceInformation
 *
 * @param schemaName The name of the schema the table belongs to
 * @param sequenceName The sequence name
 *
 * @return The sequence information.  May return {@code null} if not found.
 */
SequenceInformation getSequenceInformation(Namespace.Name schemaName, Identifier sequenceName);