Search in sources :

Example 6 with SchemaManagementTool

use of org.hibernate.tool.schema.spi.SchemaManagementTool in project hibernate-orm by hibernate.

the class SchemaValidator method validate.

@SuppressWarnings("unchecked")
public void validate(Metadata metadata, ServiceRegistry serviceRegistry) {
    LOG.runningSchemaValidator();
    Map config = new HashMap();
    config.putAll(serviceRegistry.getService(ConfigurationService.class).getSettings());
    final SchemaManagementTool tool = serviceRegistry.getService(SchemaManagementTool.class);
    final ExecutionOptions executionOptions = SchemaManagementToolCoordinator.buildExecutionOptions(config, ExceptionHandlerHaltImpl.INSTANCE);
    tool.getSchemaValidator(config).doValidation(metadata, executionOptions);
}
Also used : SchemaManagementTool(org.hibernate.tool.schema.spi.SchemaManagementTool) ExecutionOptions(org.hibernate.tool.schema.spi.ExecutionOptions) HashMap(java.util.HashMap) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

SchemaManagementTool (org.hibernate.tool.schema.spi.SchemaManagementTool)6 HashMap (java.util.HashMap)3 Map (java.util.Map)3 ExecutionOptions (org.hibernate.tool.schema.spi.ExecutionOptions)3 SQLSyntaxErrorException (java.sql.SQLSyntaxErrorException)2 SystemException (javax.transaction.SystemException)2 Transaction (javax.transaction.Transaction)2 Metadata (org.hibernate.boot.Metadata)2 StandardServiceRegistry (org.hibernate.boot.registry.StandardServiceRegistry)2 StandardServiceRegistryImpl (org.hibernate.boot.registry.internal.StandardServiceRegistryImpl)2 ExceptionHandlerCollectingImpl (org.hibernate.tool.schema.internal.ExceptionHandlerCollectingImpl)2 CommandAcceptanceException (org.hibernate.tool.schema.spi.CommandAcceptanceException)2 Test (org.junit.Test)2 StrategySelector (org.hibernate.boot.registry.selector.spi.StrategySelector)1 ExceptionHandler (org.hibernate.tool.schema.spi.ExceptionHandler)1 SchemaCreator (org.hibernate.tool.schema.spi.SchemaCreator)1 SchemaDropper (org.hibernate.tool.schema.spi.SchemaDropper)1 SourceDescriptor (org.hibernate.tool.schema.spi.SourceDescriptor)1 TargetDescriptor (org.hibernate.tool.schema.spi.TargetDescriptor)1