+ /** Prepare the generation of the SQL */
+ Map settings = new HashMap();
+ settings.putAll(
+ serviceRegistry
+ .getService(ConfigurationService.class)
+ .getSettings()
+ );
+ ExceptionHandlerCollectingImpl handler =
+ new ExceptionHandlerCollectingImpl();
+ ExecutionOptions options =
+ SchemaManagementToolCoordinator
+ .buildExecutionOptions(settings, handler);
+ final EnumSet<TargetType> targetTypes = EnumSet.of(TargetType.SCRIPT);
+ if (export)
+ targetTypes.add(TargetType.DATABASE);
+ TargetDescriptor target = new TargetDescriptor()
+ {
+ @Override
+ public EnumSet<TargetType> getTargetTypes()
+ {
+ return targetTypes;
+ }
+
+ @Override
+ public ScriptTargetOutput getScriptTargetOutput()
+ {
+ String charset =
+ (String)
+ serviceRegistry
+ .getService(ConfigurationService.class)
+ .getSettings()
+ .get(AvailableSettings.HBM2DDL_CHARSET_NAME);
+ return new ScriptTargetOutputToFile(output, charset);
+ }
+ };
+