overrideOptions.put("torque.om.generateMapInit", "true");
// om templates
CustomProjectPaths projectPaths
= new CustomProjectPaths(
new Maven2DirectoryProjectPaths(new File(".")));
projectPaths.setConfigurationDir(
new File("src/main/resources/org/apache/torque/templates/om"));
projectPaths.setSourceDir(
new File(SCHEMA_DIR));
projectPaths.setOutputDirectory(
Maven2ProjectPaths.MODIFIABLE_OUTPUT_DIR_KEY,
new File("target/generated-sources-2"));
Fileset sourceFileset = new Fileset();
Set<String> sourceIncludes = new HashSet<String>();
sourceIncludes.add("schema.xml");
sourceFileset.setIncludes(sourceIncludes);
sourceFileset.setBasedir(projectPaths.getDefaultSourcePath());
SourceProvider sourceProvider
= new FileSourceProvider(
null,
sourceFileset,
null);
UnitDescriptor unitDescriptor = new UnitDescriptor(
UnitDescriptor.Packaging.DIRECTORY,
projectPaths,
new DefaultTorqueGeneratorPaths());
unitDescriptor.setOverrideSourceProvider(sourceProvider);
unitDescriptor.setOverrideOptions(
new MapOptionsConfiguration(overrideOptions));
unitDescriptors.add(unitDescriptor);
// sql ddl templates
projectPaths
= new CustomProjectPaths(
new Maven2DirectoryProjectPaths(new File(".")));
projectPaths.setConfigurationDir(
new File("src/main/resources/org/apache/torque/templates/sql"));
projectPaths.setSourceDir(
new File(SCHEMA_DIR));
projectPaths.setOutputDirectory(
null,
new File("target/generated-sql"));
projectPaths.setOutputDirectory(
Maven2ProjectPaths.MODIFIABLE_OUTPUT_DIR_KEY,
new File("target/generated-sql-2"));
unitDescriptor = new UnitDescriptor(
UnitDescriptor.Packaging.DIRECTORY,
projectPaths,
new DefaultTorqueGeneratorPaths());
unitDescriptor.setOverrideOptions(
new MapOptionsConfiguration(overrideOptions));
unitDescriptors.add(unitDescriptor);
// sql createdb templates
projectPaths
= new CustomProjectPaths(
new Maven2DirectoryProjectPaths(new File(".")));
projectPaths.setConfigurationDir(
new File("src/main/resources/org/apache/torque/templates/sql/createdb"));
projectPaths.setSourceDir(
new File(SCHEMA_DIR));
projectPaths.setOutputDirectory(
null,
new File("target/generated-sql"));
projectPaths.setOutputDirectory(
Maven2ProjectPaths.MODIFIABLE_OUTPUT_DIR_KEY,
new File("target/generated-sql-2"));
unitDescriptor = new UnitDescriptor(
UnitDescriptor.Packaging.DIRECTORY,
projectPaths,
new DefaultTorqueGeneratorPaths());
unitDescriptor.setOverrideOptions(
new MapOptionsConfiguration(overrideOptions));
unitDescriptors.add(unitDescriptor);
// idbroker-init-sql templates
projectPaths
= new CustomProjectPaths(
new Maven2DirectoryProjectPaths(new File(".")));
projectPaths.setConfigurationDir(
new File("src/main/resources/org/apache/torque/templates/idtable"));
projectPaths.setSourceDir(
new File(SCHEMA_DIR));
projectPaths.setOutputDirectory(
null,
new File("target/generated-sql"));
projectPaths.setOutputDirectory(
Maven2ProjectPaths.MODIFIABLE_OUTPUT_DIR_KEY,
new File("target/generated-sql-2"));
unitDescriptor = new UnitDescriptor(
UnitDescriptor.Packaging.DIRECTORY,
projectPaths,
new DefaultTorqueGeneratorPaths());
unitDescriptor.setOverrideOptions(
new MapOptionsConfiguration(overrideOptions));
unitDescriptors.add(unitDescriptor);
// html doc templates
projectPaths = new CustomProjectPaths(
new Maven2DirectoryProjectPaths(new File(".")));
projectPaths.setConfigurationDir(
new File("src/main/resources/org/apache/torque/templates/doc/html"));
projectPaths.setSourceDir(
new File(SCHEMA_DIR));
projectPaths.setOutputDirectory(
null,
new File("target/generated-docs"));
projectPaths.setOutputDirectory(
Maven2ProjectPaths.MODIFIABLE_OUTPUT_DIR_KEY,
new File("target/generated-docs-2"));
unitDescriptor = new UnitDescriptor(
UnitDescriptor.Packaging.DIRECTORY,
projectPaths,
new DefaultTorqueGeneratorPaths());
unitDescriptor.setOverrideOptions(
new MapOptionsConfiguration(overrideOptions));
unitDescriptors.add(unitDescriptor);
// xdoc doc templates
projectPaths = new CustomProjectPaths(
new Maven2DirectoryProjectPaths(new File(".")));
projectPaths.setConfigurationDir(
new File("src/main/resources/org/apache/torque/templates/doc/xdoc"));
projectPaths.setSourceDir(
new File(SCHEMA_DIR));
projectPaths.setOutputDirectory(