Top Description Inners Fields Constructors Methods
org.hibernate.tool.schema.internal

public Class SchemaDropperImpl

extends Object
implements SchemaDropper
Class Inheritance
All Implemented Interfaces
org.hibernate.tool.schema.spi.SchemaDropper
Imports
java.io.Serializable, java.util.ArrayList, .Collections, .HashSet, .Iterator, .List, .Map, .Set, org.hibernate.boot.Metadata, org.hibernate.boot.model.naming.Identifier, org.hibernate.boot.model.relational.AuxiliaryDatabaseObject, .Database, .Exportable, .Namespace, .Sequence, .SqlStringGenerationContext, org.hibernate.boot.model.relational.internal.SqlStringGenerationContextImpl, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.dialect.Dialect, org.hibernate.engine.config.spi.ConfigurationService, org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.engine.jdbc.internal.FormatStyle, .Formatter, org.hibernate.engine.jdbc.spi.JdbcServices, .SqlExceptionHelper, .SqlStatementLogger, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.internal.util.StringHelper, org.hibernate.mapping.ForeignKey, .Table, org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder, org.hibernate.service.ServiceRegistry, org.hibernate.service.spi.ServiceRegistryImplementor, org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractor, org.hibernate.tool.schema.SourceType, org.hibernate.tool.schema.internal.exec.GenerationTarget, .GenerationTargetToDatabase, .JdbcContext, org.hibernate.tool.schema.spi.CommandAcceptanceException, .DelayedDropAction, .ExceptionHandler, .ExecutionOptions, .SchemaDropper, .SchemaFilter, .SchemaManagementException, .SchemaManagementTool, .ScriptSourceInput, .SourceDescriptor, .TargetDescriptor, org.jboss.logging.Logger

This is functionally nothing more than the creation script from the older SchemaExport class (plus some additional stuff in the script).
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final Logger
private final SchemaFilter
private final HibernateSchemaManagementTool

Constructor Summary

AccessConstructor and Description
public
public
public
public
SchemaDropperImpl(ServiceRegistry serviceRegistry, SchemaFilter schemaFilter)

Method Summary

Modifier and TypeMethod and Description
private void
applyConstraintDropping(Namespace namespace, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)

private static void
applySqlString(String sqlString, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)

private static void
applySqlStrings(String[] sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)

public DelayedDropAction
buildDelayedAction(Metadata
The metadata to drop
metadata
,
ExecutionOptions
The drop options
options
,
SourceDescriptor sourceDescriptor)

Implements org.hibernate.tool.schema.spi.SchemaDropper.buildDelayedAction.

Build a delayed Runnable for performing schema dropping.
private static void
checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)

public void
doDrop(Metadata
Represents the schema to be dropped.
metadata
,
ExecutionOptions
Options for executing the drop
options
,
SourceDescriptor
description of the source(s) of drop commands
sourceDescriptor
,
TargetDescriptor
description of the target(s) for the drop commands
targetDescriptor
)

Implements org.hibernate.tool.schema.spi.SchemaDropper.doDrop.

Perform a schema drop from the indicated source(s) to the indicated target(s).
public void
doDrop(Metadata metadata, ExecutionOptions options, Dialect dialect, SourceDescriptor sourceDescriptor, GenerationTarget... targets)

public void
doDrop(Metadata metadata, boolean manageNamespaces, GenerationTarget... targets)

For tests

public void
doDrop(Metadata metadata, final ServiceRegistry serviceRegistry, final Map<K, V> settings, final boolean manageNamespaces, GenerationTarget... targets)

For tests

private void
dropFromMetadata(Metadata metadata, ExecutionOptions options, Dialect dialect, Formatter formatter, GenerationTarget... targets)

private void
dropFromScript(ScriptSourceInput scriptSourceInput, ImportSqlCommandExtractor commandExtractor, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)

public List<String>

Returns:

The generation commands
generateDropCommands
(Metadata
The metadata for which to generate the creation commands.
metadata
,
final boolean manageNamespaces)

For testing...

private void
performDrop(Metadata metadata, ExecutionOptions options, Dialect dialect, SourceDescriptor sourceDescriptor, GenerationTarget... targets)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log
schemaFilterback to summary
private final SchemaFilter schemaFilter
toolback to summary
private final HibernateSchemaManagementTool tool

Constructor Detail

SchemaDropperImplback to summary
public SchemaDropperImpl(HibernateSchemaManagementTool tool)
SchemaDropperImplback to summary
public SchemaDropperImpl(HibernateSchemaManagementTool tool, SchemaFilter schemaFilter)
SchemaDropperImplback to summary
public SchemaDropperImpl(ServiceRegistry serviceRegistry)
SchemaDropperImplback to summary
public SchemaDropperImpl(ServiceRegistry serviceRegistry, SchemaFilter schemaFilter)

Method Detail

applyConstraintDroppingback to summary
private void applyConstraintDropping(Namespace namespace, Metadata metadata, Formatter formatter, ExecutionOptions options, SqlStringGenerationContext sqlStringGenerationContext, GenerationTarget... targets)
applySqlStringback to summary
private static void applySqlString(String sqlString, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
applySqlStringsback to summary
private static void applySqlStrings(String[] sqlStrings, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
buildDelayedActionback to summary
public DelayedDropAction buildDelayedAction(Metadata metadata, ExecutionOptions options, SourceDescriptor sourceDescriptor)

Implements org.hibernate.tool.schema.spi.SchemaDropper.buildDelayedAction.

Doc from org.hibernate.tool.schema.spi.SchemaDropper.buildDelayedAction.

Build a delayed Runnable for performing schema dropping. This implicitly targets the underlying data-store.

Parameters
metadata:Metadata

The metadata to drop

options:ExecutionOptions

The drop options

sourceDescriptor:SourceDescriptor

For access to the SourceDescriptor#getScriptSourceInput()

Returns:DelayedDropAction

The Runnable

Annotations
@Override
checkExportIdentifierback to summary
private static void checkExportIdentifier(Exportable exportable, Set<String> exportIdentifiers)
doDropback to summary
public void doDrop(Metadata metadata, ExecutionOptions options, SourceDescriptor sourceDescriptor, TargetDescriptor targetDescriptor)

Implements org.hibernate.tool.schema.spi.SchemaDropper.doDrop.

Doc from org.hibernate.tool.schema.spi.SchemaDropper.doDrop.

Perform a schema drop from the indicated source(s) to the indicated target(s).

Parameters
metadata:Metadata

Represents the schema to be dropped.

options:ExecutionOptions

Options for executing the drop

sourceDescriptor:SourceDescriptor

description of the source(s) of drop commands

targetDescriptor:TargetDescriptor

description of the target(s) for the drop commands

Annotations
@Override
doDropback to summary
public void doDrop(Metadata metadata, ExecutionOptions options, Dialect dialect, SourceDescriptor sourceDescriptor, GenerationTarget... targets)
doDropback to summary
public void doDrop(Metadata metadata, boolean manageNamespaces, GenerationTarget... targets)

For tests

doDropback to summary
public void doDrop(Metadata metadata, final ServiceRegistry serviceRegistry, final Map<K, V> settings, final boolean manageNamespaces, GenerationTarget... targets)

For tests

dropFromMetadataback to summary
private void dropFromMetadata(Metadata metadata, ExecutionOptions options, Dialect dialect, Formatter formatter, GenerationTarget... targets)
dropFromScriptback to summary
private void dropFromScript(ScriptSourceInput scriptSourceInput, ImportSqlCommandExtractor commandExtractor, Formatter formatter, ExecutionOptions options, GenerationTarget... targets)
generateDropCommandsback to summary
public List<String> generateDropCommands(Metadata metadata, final boolean manageNamespaces)

For testing...

Parameters
metadata:Metadata

The metadata for which to generate the creation commands.

Returns:List<String>

The generation commands

performDropback to summary
private void performDrop(Metadata metadata, ExecutionOptions options, Dialect dialect, SourceDescriptor sourceDescriptor, GenerationTarget... targets)
org.hibernate.tool.schema.internal back to summary

private Class SchemaDropperImpl.DelayedDropActionImpl

extends Object
implements DelayedDropAction, Serializable
Class Inheritance
  • java.lang.Object
  • org.hibernate.tool.schema.internal.SchemaDropperImpl.DelayedDropActionImpl
All Implemented Interfaces
java.io.Serializable, org.hibernate.tool.schema.spi.DelayedDropAction

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ArrayList<String>
private static final CoreMessageLogger
private GenerationTarget

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
perform(ServiceRegistry
Access to the ServiceRegistry
serviceRegistry
)

Implements org.hibernate.tool.schema.spi.DelayedDropAction.perform.

Perform the delayed schema drop.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commandsback to summary
private final ArrayList<String> commands
logback to summary
private static final CoreMessageLogger log
targetback to summary
private GenerationTarget target

Constructor Detail

DelayedDropActionImplback to summary
public DelayedDropActionImpl(ArrayList<String> commands, GenerationTarget target)

Method Detail

performback to summary
public void perform(ServiceRegistry serviceRegistry)

Implements org.hibernate.tool.schema.spi.DelayedDropAction.perform.

Doc from org.hibernate.tool.schema.spi.DelayedDropAction.perform.

Perform the delayed schema drop.

Parameters
serviceRegistry:ServiceRegistry

Access to the ServiceRegistry

Annotations
@Override
org.hibernate.tool.schema.internal back to summary

private Class SchemaDropperImpl.DelayedDropActionImpl.JdbcContextDelayedDropImpl

extends Object
implements JdbcContext
Class Inheritance
  • java.lang.Object
  • org.hibernate.tool.schema.internal.SchemaDropperImpl.DelayedDropActionImpl.JdbcContextDelayedDropImpl
All Implemented Interfaces
org.hibernate.tool.schema.internal.exec.JdbcContext

Field Summary

Modifier and TypeField and Description
private final JdbcConnectionAccess
private final JdbcServices
private final ServiceRegistry

Constructor Summary

AccessConstructor and Description
public

Field Detail

jdbcConnectionAccessback to summary
private final JdbcConnectionAccess jdbcConnectionAccess
jdbcServicesback to summary
private final JdbcServices jdbcServices
serviceRegistryback to summary
private final ServiceRegistry serviceRegistry

Constructor Detail

JdbcContextDelayedDropImplback to summary
public JdbcContextDelayedDropImpl(ServiceRegistry serviceRegistry)

Method Detail

getDialectback to summary
public Dialect getDialect()

Implements org.hibernate.tool.schema.internal.exec.JdbcContext.getDialect.

Annotations
@Override
getJdbcConnectionAccessback to summary
public JdbcConnectionAccess getJdbcConnectionAccess()

Implements org.hibernate.tool.schema.internal.exec.JdbcContext.getJdbcConnectionAccess.

Annotations
@Override
getServiceRegistryback to summary
public ServiceRegistry getServiceRegistry()

Implements org.hibernate.tool.schema.internal.exec.JdbcContext.getServiceRegistry.

Annotations
@Override
getSqlExceptionHelperback to summary
public SqlExceptionHelper getSqlExceptionHelper()

Implements org.hibernate.tool.schema.internal.exec.JdbcContext.getSqlExceptionHelper.

Annotations
@Override
getSqlStatementLoggerback to summary
public SqlStatementLogger getSqlStatementLogger()

Implements org.hibernate.tool.schema.internal.exec.JdbcContext.getSqlStatementLogger.

Annotations
@Override
org.hibernate.tool.schema.internal back to summary

private Class SchemaDropperImpl.JournalingGenerationTarget

extends Object
implements GenerationTarget
Class Inheritance
  • java.lang.Object
  • org.hibernate.tool.schema.internal.SchemaDropperImpl.JournalingGenerationTarget
All Implemented Interfaces
org.hibernate.tool.schema.internal.exec.GenerationTarget

Field Summary

Modifier and TypeField and Description
private final ArrayList<String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
accept(String
The command
command
)

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Accept a command
public void
public void
release()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Release this target, giving it a change to release its resources.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commandsback to summary
private final ArrayList<String> commands

Constructor Detail

JournalingGenerationTargetback to summary
private JournalingGenerationTarget()

Method Detail

acceptback to summary
public void accept(String command)

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.accept.

Accept a command

Parameters
command:String

The command

Annotations
@Override
prepareback to summary
public void prepare()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.prepare.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.prepare.

Prepare for accepting actions

Annotations
@Override
releaseback to summary
public void release()

Implements org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Doc from org.hibernate.tool.schema.internal.exec.GenerationTarget.release.

Release this target, giving it a change to release its resources.

Annotations
@Override