db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r473817 [2/3] - in /db/torque: maven-plugin/trunk/ maven-plugin/trunk/src/plugin-resources/templates/ maven-plugin/trunk/xdocs/ maven2-plugin/trunk/ maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/ maven2-plugin/trunk/src/test/java...
Date Sat, 11 Nov 2006 22:32:43 GMT
Modified: db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/OMMojo.java
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/OMMojo.java?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/OMMojo.java (original)
+++ db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/OMMojo.java Sat Nov 11 14:32:42 2006
@@ -1,1052 +1,1055 @@
-package org.apache.torque.mojo;
-
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.File;
-
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.tools.ant.BuildException;
-
-/**
- * Generates the sources for the persistence classes from the schema.xml files.
- *
- * @author Raphael Pieroni (rafale_at_codehaus.org)
- * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
- *
- * @goal om
- * @execute phase="generate-sources"
- * @requiresDependencyResolution compile
- */
-public class OMMojo
-        extends DataModelTaskMojo
-{
-    // The following three dummies trick the Mojo Description Extractor
-    // into setting the correct default values for
-    // outputDir, reportFile and contextPropertiesPath
-    /**
-     * The directory in which the sources for the persistence classes will be
-     * generated.
-     *
-     * @parameter property="outputDir"
-     *            expression="${project.build.directory}/generated-sources/torque"
-     */
-    private String dummy;
-
-    /**
-     * The location where the report file will be generated.
-     *
-     * @parameter property="reportFile"
-     *            expression="../../torque/report.${project.artifact.artifactId}.om.generation"
-     */
-    private String dummy2;
-
-    /**
-     * The location where the context property file for velocity will be
-     * generated.
-     *
-     * @parameter property="contextPropertiesPath"
-     *            expression="${project.build.directory}/torque/context.om.properties"
-     */
-    private String dummy3;
-
-    /**
-     * The context property for the target package.
-     */
-    public static final String TARGET_PACKAGE_CONTEXT_PROPERTY
-            = "targetPackage";
-
-    /**
-     * The context property for the prefix of the class name for
-     * the generated base classes,
-     */
-    public static final String BASE_PREFIX_CONTEXT_PROPERTY
-            = "basePrefix";
-
-    /**
-     * The context property which determines the name suffix of
-     * generated bean classes.
-     */
-    public static final String BEAN_SUFFIX_CONTEXT_PROPERTY
-            = "beanSuffix";
-
-    /**
-     * The context property for the subpackage of the generated
-     * database Map classes.
-     */
-    public static final String SUBPACKAGE_MAP_CONTEXT_PROPERTY
-            = "subpackageMap";
-
-    /**
-     * The context property for the subpackage of the generated
-     * base Object, Peer, and Manager classes.
-     */
-    public static final String SUBPACKAGE_BASE_CONTEXT_PROPERTY
-            = "subpackageBase";
-
-    /**
-     * The context property for the subpackage of the generated
-     * base bean classes.
-     */
-    public static final String SUBPACKAGE_BASE_BEAN_CONTEXT_PROPERTY
-            = "subpackageBaseBean";
-
-    /**
-     * The context property for the subpackage of the generated
-     * bean classes.
-     */
-    public static final String SUBPACKAGE_BEAN_CONTEXT_PROPERTY
-            = "subpackageBean";
-
-    /**
-     * The context property for the subpackage of the generated
-     * manager classes.
-     */
-    public static final String SUBPACKAGE_MANAGER_CONTEXT_PROPERTY
-            = "subpackageManager";
-
-    /**
-     * The context property for the subpackage of the generated
-     * data object classes.
-     */
-    public static final String SUBPACKAGE_OBJECT_CONTEXT_PROPERTY
-            = "subpackageObject";
-
-    /**
-     * The context property for the subpackage of the generated
-     * peer classes.
-     */
-    public static final String SUBPACKAGE_PEER_CONTEXT_PROPERTY
-            = "subpackagePeer";
-
-    /**
-     * The context property where the generation of the getByName-
-     * Methods can be turned on and off.
-     */
-    public static final String ADD_GET_BY_NAME_METHOD_CONTEXT_PROPERTY
-            = "addGetByNameMethod";
-
-    /**
-     * The context property where it is configured whether the
-     * data objects implement a Retrievable interface.
-     */
-    public static final String ADD_INTAKE_RETRIEVABLE_CONTEXT_PROPERTY
-            = "addIntakeRetrievable";
-
-    /**
-     * The context property where it is configured whether the
-     * data objects implement a Retrievable interface.
-     */
-    public static final String RETRIEVABLE_INTERFACE_CONTEXT_PROPERTY
-            = "retrievableInterface";
-
-    /**
-     * The context property where the generation of the save
-     * methods can be turned on and off.
-     */
-    public static final String ADD_SAVE_METHOD_CONTEXT_PROPERTY
-            = "addSaveMethod";
-
-    /**
-     * The context property where the exception thown by save methods
-     * can be configured.
-     */
-    public static final String SAVE_EXCEPTION_CONTEXT_PROPERTY
-            = "saveException";
-
-    /**
-     * The context property where it is configured whether methods
-     * are generated to easily retrieve foreign key relationships.
-     */
-    public static final String COMPLEX_OBJECT_MODEL_CONTEXT_PROPERTY
-            = "complexObjectModel";
-
-    /**
-     * The context property which determines whether empty cached
-     * foreign key relations should be filled automatically.
-     */
-    public static final String SILENT_DB_FETCH_CONTEXT_PROPERTY
-            = "silentDbFetch";
-
-    /**
-     * The context property which determines whether manager classes
-     * are generated.
-     */
-    public static final String USE_MANAGERS_CONTEXT_PROPERTY
-            = "useManagers";
-
-    /**
-     * The context property which determines whether foreign key relationships
-     * are cached.
-     */
-    public static final String OBJECT_IS_CACHING_CONTEXT_PROPERTY
-            = "objectIsCaching";
-
-    /**
-     * The context property which determines whether isXXX methods are
-     * generated for boolean properties instead of getXXX methods.
-     */
-    public static final String CORRECT_GETTERS_CONTEXT_PROPERTY
-            = "correctGetters";
-
-    /**
-     * The context property which determines whether java5 generics
-     * and easy iteration are used in generated code.
-     */
-    public static final String ENABLE_JAVA_5_FEATURES_CONTEXT_PROPERTY
-            = "enableJava5Features";
-
-    /**
-     * The context property which determines whether time stamps are put
-     * into generated files.
-     */
-    public static final String ADD_TIME_STAMP_CONTEXT_PROPERTY
-            = "addTimeStamp";
-
-    /**
-     * The context property which determines whether bean classes
-     * should be generated.
-     */
-    public static final String GENERATE_BEANS_CONTEXT_PROPERTY
-            = "generateBeans";
-
-    /**
-     * The prefix for the base classes.
-     *
-     * @parameter expression="Base"
-     */
-    private String basePrefix;
-
-    /**
-     * The suffix for the class name of the bean classes.
-     *
-     * @parameter expression="Bean"
-     */
-    private String beanSuffix;
-
-    /**
-     * The subpackage (relative to <code>targetPackage</code>
-     * where Torque will put the generated Java classes for the database map.
-     *
-     * @parameter expression="map"
-     */
-
-    private String subpackageMap;
-
-    /**
-     * The subpackage (relative to <code>targetPackage</code>)
-     * where Torque will put the generated Peer Java classes.
-     * If not set, the Peer classes will be generated in
-     * <code>targetPackage</code>.
-     *
-     * @parameter
-     */
-    private String subpackagePeer;
-
-    /**
-     * The subpackage (relative to <code>targetPackage</code>)
-     * where Torque will put the generated data object Java classes.
-     * If not set, the object classes will be generated in
-     * <code>targetPackage</code>.
-     *
-     * @parameter
-     */
-    private String subpackageObject;
-
-    /**
-     * The subpackage (relative to <code>targetPackage</code>)
-     * where Torque will put the generated Java Manager classes,
-     * if they are generated at all.
-     * If not set, the Manager classes will be generated in
-     * <code>targetPackage</code>.
-     *
-     * @parameter
-     */
-    private String subpackageManager;
-
-    /**
-     * The subpackage (relative to <code>targetPackage</code>)
-     * where Torque will put the generated JavaBean classes,
-     * if they are generated at all.
-     *
-     * @parameter expression="bean"
-     */
-    private String subpackageBean;
-
-    /**
-     * The subpackage (relative to <code>targetPackage</code>)
-     * where Torque will put the generated BaseObject, BasePeer,
-     * (and BaseManager, if they are generated at all) Java classes.
-     * If not set, the Base classes will be generated in
-     * <code>targetPackage</code>.
-     *
-     * @parameter
-     */
-    private String subpackageBase;
-
-    /**
-     * The subpackage (relative to <code>targetPackage</code>)
-     * where Torque will put the generated BaseBean Java classes,
-     * if they are generated at all.
-     *
-     * @parameter expression="bean"
-     */
-    private String subpackageBaseBean;
-
-    /**
-     * If true, Torque adds methods to get database fields by name/position.
-     *
-     * @parameter expression="true"
-     */
-    private boolean addGetByNameMethod;
-
-    /**
-     * If true, the data objects will implement a Retrievable interface.
-     *
-     * @parameter expression="false"
-     */
-    private boolean addRetrievableInterface;
-
-    /**
-     * The fully qualified class name of the retrievable interface
-     * to be implemented by the data objects.
-     *
-     * @parameter expression="org.apache.turbine.om.Retrievable"
-     */
-    private String retrievableInterface;
-
-    /**
-     * Determines whether save()-Methods should be added to the data objects.
-     *
-     * @parameter expression="true"
-     */
-    private boolean addSaveMethod;
-
-    /**
-     * Defines which Exception should be thrown by the Object.save() method.
-     *
-     * @parameter expression="Exception"
-     */
-    private String saveException;
-
-    /**
-     * Determines whether a time stamp and a serialVersionUID will be
-     * added to generated objects.
-     *
-     * @parameter expression="true"
-     */
-    private boolean addTimeStamp;
-
-    /**
-     * If true, Torque generates data objects with collection support
-     * and methods to easily retrieve foreign key relationships.
-     *
-     * @parameter expression="true"
-     */
-    private boolean complexObjectModel;
-
-    /**
-     * If true, Torque will generate Manager classes that use JCS for caching.
-     *
-     * @parameter expression="false"
-     */
-    private boolean useManagers;
-
-    /**
-     * If true, Torque generates data objects that cache their foreign key
-     * relationships.
-     *
-     * @parameter expression="true"
-     */
-    private boolean objectIsCaching;
-
-    /**
-     * If true and objectIsCaching is true, Torque silently fetches
-     * foreign key relation collections if the collection is not yet
-     * initialized.
-     *
-     * @parameter expression="true"
-     */
-    private boolean silentDbFetch;
-
-    /**
-     * If true, Torque generates isXXX getter methods for boolean columns.
-     *
-     * @parameter expression="false"
-     */
-    private boolean correctGetters;
-
-    /**
-     * If true, Torque generates a bean object for each data object,
-     * plus methods to convert data objects to beans and vice versa.
-     *
-     * @parameter expression="false"
-     */
-    private boolean generateBeans;
-
-    /**
-     * Whether Java5 generics and iteration shorthand should be used
-     * in generated code.
-     *
-     * @parameter expression="false"
-     */
-    private boolean enableJava5Features;
-
-    /**
-     * Creates a new TorqueOMMojo object.
-     */
-    public OMMojo()
-    {
-    }
-
-    /**
-     * Generates the OM classes for a Torque project and adds them to
-     * the comile sources of the project.
-     *
-     * @throws MojoExecutionException If an error occurs during generation.
-     *
-     * @see TexenTaskMojo#execute()
-     * @see org.apache.maven.plugin.Mojo#execute()
-     */
-    public void execute() throws MojoExecutionException
-    {
-        super.execute();
-
-        try
-        {
-            File outputDirectory = new File(super.getOutputDir());
-            getLog().info ("torque java sources generated into: "
-                    + outputDirectory.getAbsolutePath());
-
-            if (getProject() != null)
-            {
-                getProject().addCompileSourceRoot(outputDirectory.getPath());
-            }
-        }
-        catch (BuildException e)
-        {
-            getLog().error(e.getMessage());
-            throw new MojoExecutionException(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * Returns the path to the control template.
-     *
-     * @return "om/Control.vm"
-     */
-    protected String getControlTemplate()
-    {
-        return "om/Control.vm";
-    }
-
-    /**
-     * Returns the context properties for the Texen task.
-     *
-     * @return The PropertiesConfiguration containing all context properties,
-     *         not null.
-     */
-    protected PropertiesConfiguration getMojoContextProperties()
-    {
-        PropertiesConfiguration configuration = new PropertiesConfiguration();
-        configuration.addProperty(
-                TARGET_DATABASE_CONTEXT_PROPERTY,
-                super.getTargetDatabase());
-
-        configuration.addProperty(
-                TARGET_PACKAGE_CONTEXT_PROPERTY,
-                getTargetPackage());
-
-        configuration.addProperty(
-                BASE_PREFIX_CONTEXT_PROPERTY,
-                basePrefix);
-
-        configuration.addProperty(
-                SUBPACKAGE_MAP_CONTEXT_PROPERTY,
-                subpackageMap);
-
-        configuration.addProperty(
-                SUBPACKAGE_BASE_CONTEXT_PROPERTY,
-                subpackageBase);
-
-        configuration.addProperty(
-                SUBPACKAGE_BASE_BEAN_CONTEXT_PROPERTY,
-                subpackageBaseBean);
-
-        configuration.addProperty(
-                SUBPACKAGE_BEAN_CONTEXT_PROPERTY,
-                subpackageBean);
-
-        configuration.addProperty(
-                SUBPACKAGE_MANAGER_CONTEXT_PROPERTY,
-                subpackageManager);
-
-        configuration.addProperty(
-                SUBPACKAGE_OBJECT_CONTEXT_PROPERTY,
-                subpackageObject);
-
-        configuration.addProperty(
-                SUBPACKAGE_PEER_CONTEXT_PROPERTY,
-                subpackagePeer);
-
-        configuration.addProperty(
-                ADD_GET_BY_NAME_METHOD_CONTEXT_PROPERTY,
-                Boolean.toString(addGetByNameMethod));
-
-        configuration.addProperty(
-                ADD_INTAKE_RETRIEVABLE_CONTEXT_PROPERTY,
-                Boolean.toString(addRetrievableInterface));
-
-        configuration.addProperty(
-                RETRIEVABLE_INTERFACE_CONTEXT_PROPERTY,
-                retrievableInterface);
-
-        configuration.addProperty(
-                ADD_SAVE_METHOD_CONTEXT_PROPERTY,
-                Boolean.toString(addSaveMethod));
-
-        configuration.addProperty(
-                ADD_TIME_STAMP_CONTEXT_PROPERTY,
-                Boolean.toString(addTimeStamp));
-
-        configuration.addProperty(
-                BEAN_SUFFIX_CONTEXT_PROPERTY,
-                beanSuffix);
-
-        configuration.addProperty(
-                GENERATE_BEANS_CONTEXT_PROPERTY,
-                Boolean.toString(generateBeans));
-
-        configuration.addProperty(
-                COMPLEX_OBJECT_MODEL_CONTEXT_PROPERTY,
-                Boolean.toString(complexObjectModel));
-
-        configuration.addProperty(
-                CORRECT_GETTERS_CONTEXT_PROPERTY,
-                Boolean.toString(correctGetters));
-
-        configuration.addProperty(
-                ENABLE_JAVA_5_FEATURES_CONTEXT_PROPERTY,
-                Boolean.toString(correctGetters));
-
-        configuration.addProperty(
-                OBJECT_IS_CACHING_CONTEXT_PROPERTY,
-                Boolean.toString(objectIsCaching));
-
-        configuration.addProperty(
-                SAVE_EXCEPTION_CONTEXT_PROPERTY,
-                saveException);
-
-        configuration.addProperty(
-                SILENT_DB_FETCH_CONTEXT_PROPERTY,
-                Boolean.toString(silentDbFetch));
-
-        configuration.addProperty(
-                USE_MANAGERS_CONTEXT_PROPERTY,
-                Boolean.toString(useManagers));
-
-        return configuration;
-    }
-
-    /**
-     * Returns the prefix for the base classes.
-     *
-     * @return the prefix for the base classes.
-     */
-    public String getBasePrefix()
-    {
-        return basePrefix;
-    }
-
-    /**
-     * Sets the prefix for the names of the base classes.
-     *
-     * @param basePrefix the prefix for the base classes.
-     */
-    public void setBasePrefix(String basePrefix)
-    {
-        this.basePrefix = basePrefix;
-    }
-
-    /**
-     * Returns the suffix for the names of the bean classes.
-     *
-     * @return the suffix for the bean classes.
-     */
-    public String getBeanSuffix()
-    {
-        return beanSuffix;
-    }
-
-    /**
-     * Sets the suffix for the names of the bean classes.
-     *
-     * @param beanSuffix the suffix for the bean classes.
-     */
-    public void setBeanSuffix(String beanSuffix)
-    {
-        this.beanSuffix = beanSuffix;
-    }
-
-    /**
-     * Gets the subpackage for the database map classes.
-     *
-     * @return the subpackage for the database map classes.
-     */
-    public String getSubpackageMap()
-    {
-        return subpackageMap;
-    }
-
-    /**
-     * Sets the subpackage for the database map classes.
-     *
-     * @param subpackageMap the subpackage for the database map classes.
-     */
-    public void setSubpackageMap(String subpackageMap)
-    {
-        this.subpackageMap = subpackageMap;
-    }
-
-    /**
-     * Gets the subpackage for the base Object, Peer, and Manager classes.
-     *
-     * @return the subpackage for the base Object, Peer, and Manager classes,
-     *         or null if not set.
-     */
-    public String getSubpackageBase()
-    {
-        return subpackageBase;
-    }
-
-    /**
-     * Sets the subpackage for the base Object, Peer, and Manager classes.
-     *
-     * @param subpackageBase the subpackage for the base Object, Peer,
-     *        and Manager classes.
-     */
-    public void setSubpackageBase(String subpackageBase)
-    {
-        this.subpackageBase = subpackageBase;
-    }
-
-    /**
-     * Gets the subpackage for the base peer, object, and manager classes.
-     *
-     * @return the subpackage for the base peer, object, and manager classes,
-     *         or null if not set.
-     */
-    public String getSubpackageBaseBean()
-    {
-        return subpackageBaseBean;
-    }
-
-    /**
-     * Sets the subpackage for the base bean classes.
-     *
-     * @param subpackageBaseBean the subpackage for the base bean classes.
-     */
-    public void setSubpackageBaseBean(String subpackageBaseBean)
-    {
-        this.subpackageBaseBean = subpackageBaseBean;
-    }
-
-    /**
-     * Gets the subpackage for the bean classes.
-     *
-     * @return the subpackage for the bean classes.
-     */
-    public String getSubpackageBean()
-    {
-        return subpackageBean;
-    }
-
-    /**
-     * Sets the subpackage for the bean classes.
-     *
-     * @param subpackageBean the subpackage for the bean classes.
-     */
-    public void setSubpackageBean(String subpackageBean)
-    {
-        this.subpackageBean = subpackageBean;
-    }
-
-    /**
-     * Gets the subpackage for the manager classes.
-     *
-     * @return the subpackage for the manager classes, or null if not set.
-     */
-    public String getSubpackageManager()
-    {
-        return subpackageManager;
-    }
-
-    /**
-     * Sets the subpackage for the manager classes.
-     *
-     * @param subpackageManager the subpackage for the manager classes.
-     */
-    public void setSubpackageManager(String subpackageManager)
-    {
-        this.subpackageManager = subpackageManager;
-    }
-
-    /**
-     * Gets the subpackage for the data object classes.
-     *
-     * @return the subpackage for the data object classes.
-     */
-    public String getSubpackageObject()
-    {
-        return subpackageObject;
-    }
-
-    /**
-     * Sets the subpackage for the data object classes.
-     *
-     * @param subpackageObject the subpackage for the data object classes.
-     */
-    public void setSubpackageObject(String subpackageObject)
-    {
-        this.subpackageObject = subpackageObject;
-    }
-
-    /**
-     * Gets the subpackage for the peer classes.
-     *
-     * @return the subpackage for the peer classes, or null if not set.
-     */
-    public String getSubpackagePeer()
-    {
-        return subpackagePeer;
-    }
-
-    /**
-     * Sets the subpackage for the peer classes.
-     *
-     * @param subpackagePeer the subpackage for the peer classes.
-     */
-    public void setSubpackagePeer(String subpackagePeer)
-    {
-        this.subpackagePeer = subpackagePeer;
-    }
-
-    /**
-     * Returns whether Torque adds methods to get database fields
-     * by name/position.
-     *
-     * @return true if Torque adds methods to get database fields
-     *         by name/position, false otherwise.
-     */
-    public boolean isAddGetByNameMethod()
-    {
-        return addGetByNameMethod;
-    }
-
-    /**
-     * Sets whether Torque should add methods to get database fields
-     * by name/position.
-     *
-     * @param addGetByNameMethod whether Torque should add methods to get
-     *        database fields by name/position.
-     */
-    public void setAddGetByNameMethod(boolean addGetByNameMethod)
-    {
-        this.addGetByNameMethod = addGetByNameMethod;
-    }
-
-    /**
-     * Returns whether the data objects will implement an Retrievable interface.
-     *
-     * @return true if the data objects will implement an Retrievable interface,
-     *         false otherwise.
-     */
-    public boolean isAddRetrievableInterface()
-    {
-        return addRetrievableInterface;
-    }
-
-    /**
-     * Sets whether the data objects should implement an Retrievable interface.
-     *
-     * @param addRetrievableInterface whether the data objects should implement
-     *        a Retrievable interface.
-     */
-    public void setAddRetrievableInterface(boolean addRetrievableInterface)
-    {
-        this.addRetrievableInterface = addRetrievableInterface;
-    }
-
-    /**
-     * Returns whether Torque will add save methods to the data objects.
-     *
-     * @return true if Torque will add save methods to the data objects,
-     *         false otherwise.
-     */
-    public boolean isAddSaveMethod()
-    {
-        return addSaveMethod;
-    }
-
-    /**
-     * Sets whether Torque should add save methods to the data objects.
-     *
-     * @param addSaveMethod whether Torque should add save methods to the
-     *        data objects.
-     */
-    public void setAddSaveMethod(boolean addSaveMethod)
-    {
-        this.addSaveMethod = addSaveMethod;
-    }
-
-    /**
-     * Returns whether Torque puts time stamps in generated om files.
-     *
-     * @return true if Torque puts time stamps in generated om files,
-     *         false otherwise.
-     */
-    public boolean isAddTimeStamp()
-    {
-        return addTimeStamp;
-    }
-
-    /**
-     * Sets whether Torque puts time stamps in generated om files.
-     *
-     * @param addTimeStamp whether Torque puts time stamps in generated
-     *        om files.
-     */
-    public void setAddTimeStamp(boolean addTimeStamp)
-    {
-        this.addTimeStamp = addTimeStamp;
-    }
-
-    /**
-     * Returns whether Torque generates data objects with collection support
-     * and methods to easily retrieve foreign key relationships.
-     *
-     * @return true if Torque generates data objects with collection support
-     *         and methods to easily retrieve foreign key relationships,
-     *         false otherwise.
-     */
-    public boolean isComplexObjectModel()
-    {
-        return complexObjectModel;
-    }
-
-    /**
-     * Sets whether Torque generates data objects with collection support
-     * and methods to easily retrieve foreign key relationships.
-     *
-     * @param complexObjectModel whether Torque generates data objects
-     *        with collection support and methods to easily retrieve
-     *        foreign key relationships, false otherwise.
-     */
-    public void setComplexObjectModel(boolean complexObjectModel)
-    {
-        this.complexObjectModel = complexObjectModel;
-    }
-
-    /**
-     * Returns whether Torque generates isXXX getter methods for boolean
-     * columns.
-     *
-     * @return true if Torque generates isXXX getter methods for boolean
-     *         columns, false if Torque generates getXXX getter methods
-     *         for boolean columns.
-     */
-    public boolean isCorrectGetters()
-    {
-        return correctGetters;
-    }
-
-    /**
-     * Sets whether Torque generates isXXX getter methods for boolean
-     * columns.
-     *
-     * @param correctGetters true if Torque generates isXXX getter methods
-     *        for boolean columns, false if Torque generates getXXX getter
-     *        methods for boolean columns.
-     */
-    public void setCorrectGetters(boolean correctGetters)
-    {
-        this.correctGetters = correctGetters;
-    }
-
-    /**
-     * Returns whether Java5 generics and iteration shorthand will be used
-     * in generated code.
-     *
-     * @return true if Java5 generics and iteration shorthand will be used
-     *         in generated code, false to generate 1.4-compliant code.
-     */
-    public boolean isEnableJava5Features()
-    {
-        return enableJava5Features;
-    }
-
-    /**
-     * Sets whether Java5 generics and iteration shorthand should be used
-     * in generated code.
-     *
-     * @param enableJava5Features true if Java5 generics and iteration
-     *        shorthand will be used in generated code, false to generate
-     *        1.4-compliant code.
-     */
-    public void setEnableJava5Features(boolean enableJava5Features)
-    {
-        this.enableJava5Features = enableJava5Features;
-    }
-
-    /**
-     * Returns  whether bean classes will be generated.
-     *
-     * @return true if bean classes will be generated, false otherwise.
-     */
-    public boolean isGenerateBeans()
-    {
-        return generateBeans;
-    }
-
-    /**
-     * Sets whether bean classes should be generated.
-     *
-     * @param generateBeans whether bean classes should be generated.
-     */
-    public void setGenerateBeans(boolean generateBeans)
-    {
-        this.generateBeans = generateBeans;
-    }
-
-    /**
-     * Returns whether data objects cache their foreign key relationships.
-     *
-     * @return true if data objects cache their foreign key relationships,
-     *         false otherwise.
-     */
-    public boolean isObjectIsCaching()
-    {
-        return objectIsCaching;
-    }
-
-    /**
-     * Sets whether data objects cache their foreign key relationships.
-     *
-     * @param objectIsCaching true if data objects cache their
-     *        foreign key relationships, false otherwise.
-     */
-    public void setObjectIsCaching(boolean objectIsCaching)
-    {
-        this.objectIsCaching = objectIsCaching;
-    }
-
-    /**
-     * Returns the fully qualified class name of the Retrievable interface
-     * which should be implemented by the generated data objects.
-     *
-     * @return the fully qualified class name of the Retrievable interface.
-     */
-    public String getRetrievableInterface()
-    {
-        return retrievableInterface;
-    }
-
-    /**
-     * Sets the fully qualified class name of the Retrievable interface
-     * which should be implemented by the generated data objects.
-     *
-     * @param retrievableInterface the fully qualified class name of the
-     *        Retrievable interface.
-     */
-    public void setRetrievableInterface(String retrievableInterface)
-    {
-        this.retrievableInterface = retrievableInterface;
-    }
-
-    /**
-     * Returns the class name of the Exception which should be thrown
-     * by the save methods of the generated data objects.
-     *
-     * @return the class name of the Exception which should be thrown
-     *         by the generated save methods.
-     */
-    public String getSaveException()
-    {
-        return saveException;
-    }
-
-    /**
-     * Sets the class name of the Exception which should be thrown
-     * by the save methods of the generated data objects.
-     *
-     * @param saveException the class name of the Exception
-     *        which should be thrown by the generated save methods.
-     */
-    public void setSaveException(String saveException)
-    {
-        this.saveException = saveException;
-    }
-
-    /**
-     * Returns whether Torque silently fetches foreign key relation collections
-     * if the collection is not yet initialized.
-     *
-     * @return true if Torque silently fetches foreign key relation collections
-     *         if the collection is not yet initialized, false otherwise.
-     */
-    public boolean isSilentDbFetch()
-    {
-        return silentDbFetch;
-    }
-
-    /**
-     * Sets whether Torque should silently fetches foreign key relation
-     * collections if the collection is not yet initialized.
-     *
-     * @param silentDbFetch whether Torque should silently fetch
-     *        foreign key relation collections if the collection
-     *        is not yet initialized.
-     */
-    public void setSilentDbFetch(boolean silentDbFetch)
-    {
-        this.silentDbFetch = silentDbFetch;
-    }
-
-    /**
-     * Returns whether Torque will generate Manager classes that use JCS
-     * for caching.
-     *
-     * @return true if Torque will generate Manager classes that use JCS
-     *         for caching, false otherwise.
-     */
-    public boolean isUseManagers()
-    {
-        return useManagers;
-    }
-
-    /**
-     * Sets whether Torque should generate Manager classes that use JCS
-     * for caching.
-     *
-     * @param useManagers whether Torque should generate Manager classes
-     *        that use JCS for caching.
-     */
-    public void setUseManagers(boolean useManagers)
-    {
-        this.useManagers = useManagers;
-    }
-}
+package org.apache.torque.mojo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.tools.ant.BuildException;
+
+/**
+ * Generates the sources for the persistence classes from the schema.xml files.
+ *
+ * @author Raphael Pieroni (rafale_at_codehaus.org)
+ * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
+ *
+ * @goal om
+ * @execute phase="generate-sources"
+ * @requiresDependencyResolution compile
+ */
+public class OMMojo
+        extends DataModelTaskMojo
+{
+    // The following three dummies trick the Mojo Description Extractor
+    // into setting the correct default values for
+    // outputDir, reportFile and contextPropertiesPath
+    /**
+     * The directory in which the sources for the persistence classes will be
+     * generated.
+     *
+     * @parameter property="outputDir"
+     *            expression="${project.build.directory}/generated-sources/torque"
+     */
+    private String dummy;
+
+    /**
+     * The location where the report file will be generated.
+     *
+     * @parameter property="reportFile"
+     *            expression="../../torque/report.${project.artifact.artifactId}.om.generation"
+     */
+    private String dummy2;
+
+    /**
+     * The location where the context property file for velocity will be
+     * generated.
+     *
+     * @parameter property="contextPropertiesPath"
+     *            expression="${project.build.directory}/torque/context.om.properties"
+     */
+    private String dummy3;
+
+    /**
+     * The context property for the target package.
+     */
+    public static final String TARGET_PACKAGE_CONTEXT_PROPERTY
+            = "targetPackage";
+
+    /**
+     * The context property for the prefix of the class name for
+     * the generated base classes,
+     */
+    public static final String BASE_PREFIX_CONTEXT_PROPERTY
+            = "basePrefix";
+
+    /**
+     * The context property which determines the name suffix of
+     * generated bean classes.
+     */
+    public static final String BEAN_SUFFIX_CONTEXT_PROPERTY
+            = "beanSuffix";
+
+    /**
+     * The context property for the subpackage of the generated
+     * database Map classes.
+     */
+    public static final String SUBPACKAGE_MAP_CONTEXT_PROPERTY
+            = "subpackageMap";
+
+    /**
+     * The context property for the subpackage of the generated
+     * base Object, Peer, and Manager classes.
+     */
+    public static final String SUBPACKAGE_BASE_CONTEXT_PROPERTY
+            = "subpackageBase";
+
+    /**
+     * The context property for the subpackage of the generated
+     * base bean classes.
+     */
+    public static final String SUBPACKAGE_BASE_BEAN_CONTEXT_PROPERTY
+            = "subpackageBaseBean";
+
+    /**
+     * The context property for the subpackage of the generated
+     * bean classes.
+     */
+    public static final String SUBPACKAGE_BEAN_CONTEXT_PROPERTY
+            = "subpackageBean";
+
+    /**
+     * The context property for the subpackage of the generated
+     * manager classes.
+     */
+    public static final String SUBPACKAGE_MANAGER_CONTEXT_PROPERTY
+            = "subpackageManager";
+
+    /**
+     * The context property for the subpackage of the generated
+     * data object classes.
+     */
+    public static final String SUBPACKAGE_OBJECT_CONTEXT_PROPERTY
+            = "subpackageObject";
+
+    /**
+     * The context property for the subpackage of the generated
+     * peer classes.
+     */
+    public static final String SUBPACKAGE_PEER_CONTEXT_PROPERTY
+            = "subpackagePeer";
+
+    /**
+     * The context property where the generation of the getByName-
+     * Methods can be turned on and off.
+     */
+    public static final String ADD_GET_BY_NAME_METHOD_CONTEXT_PROPERTY
+            = "addGetByNameMethod";
+
+    /**
+     * The context property where it is configured whether the
+     * data objects implement a Retrievable interface.
+     */
+    public static final String ADD_INTAKE_RETRIEVABLE_CONTEXT_PROPERTY
+            = "addIntakeRetrievable";
+
+    /**
+     * The context property where it is configured whether the
+     * data objects implement a Retrievable interface.
+     */
+    public static final String RETRIEVABLE_INTERFACE_CONTEXT_PROPERTY
+            = "retrievableInterface";
+
+    /**
+     * The context property where the generation of the save
+     * methods can be turned on and off.
+     */
+    public static final String ADD_SAVE_METHOD_CONTEXT_PROPERTY
+            = "addSaveMethod";
+
+    /**
+     * The context property where the exception thown by save methods
+     * can be configured.
+     */
+    public static final String SAVE_EXCEPTION_CONTEXT_PROPERTY
+            = "saveException";
+
+    /**
+     * The context property where it is configured whether methods
+     * are generated to easily retrieve foreign key relationships.
+     */
+    public static final String COMPLEX_OBJECT_MODEL_CONTEXT_PROPERTY
+            = "complexObjectModel";
+
+    /**
+     * The context property which determines whether empty cached
+     * foreign key relations should be filled automatically.
+     */
+    public static final String SILENT_DB_FETCH_CONTEXT_PROPERTY
+            = "silentDbFetch";
+
+    /**
+     * The context property which determines whether manager classes
+     * are generated.
+     */
+    public static final String USE_MANAGERS_CONTEXT_PROPERTY
+            = "useManagers";
+
+    /**
+     * The context property which determines whether foreign key relationships
+     * are cached.
+     */
+    public static final String OBJECT_IS_CACHING_CONTEXT_PROPERTY
+            = "objectIsCaching";
+
+    /**
+     * The context property which determines whether isXXX methods are
+     * generated for boolean properties instead of getXXX methods.
+     */
+    public static final String CORRECT_GETTERS_CONTEXT_PROPERTY
+            = "correctGetters";
+
+    /**
+     * The context property which determines whether java5 generics
+     * and easy iteration are used in generated code.
+     */
+    public static final String ENABLE_JAVA_5_FEATURES_CONTEXT_PROPERTY
+            = "enableJava5Features";
+
+    /**
+     * The context property which determines whether time stamps are put
+     * into generated files.
+     */
+    public static final String ADD_TIME_STAMP_CONTEXT_PROPERTY
+            = "addTimeStamp";
+
+    /**
+     * The context property which determines whether bean classes
+     * should be generated.
+     */
+    public static final String GENERATE_BEANS_CONTEXT_PROPERTY
+            = "generateBeans";
+
+    /**
+     * The prefix for the base classes.
+     *
+     * @parameter expression="Base"
+     */
+    private String basePrefix;
+
+    /**
+     * The suffix for the class name of the bean classes.
+     *
+     * @parameter expression="Bean"
+     */
+    private String beanSuffix;
+
+    /**
+     * The subpackage (relative to <code>targetPackage</code>
+     * where Torque will put the generated Java classes for the database map.
+     *
+     * @parameter expression="map"
+     */
+
+    private String subpackageMap;
+
+    /**
+     * The subpackage (relative to <code>targetPackage</code>)
+     * where Torque will put the generated Peer Java classes.
+     * If not set, the Peer classes will be generated in
+     * <code>targetPackage</code>.
+     *
+     * @parameter
+     */
+    private String subpackagePeer;
+
+    /**
+     * The subpackage (relative to <code>targetPackage</code>)
+     * where Torque will put the generated data object Java classes.
+     * If not set, the object classes will be generated in
+     * <code>targetPackage</code>.
+     *
+     * @parameter
+     */
+    private String subpackageObject;
+
+    /**
+     * The subpackage (relative to <code>targetPackage</code>)
+     * where Torque will put the generated Java Manager classes,
+     * if they are generated at all.
+     * If not set, the Manager classes will be generated in
+     * <code>targetPackage</code>.
+     *
+     * @parameter
+     */
+    private String subpackageManager;
+
+    /**
+     * The subpackage (relative to <code>targetPackage</code>)
+     * where Torque will put the generated JavaBean classes,
+     * if they are generated at all.
+     *
+     * @parameter expression="bean"
+     */
+    private String subpackageBean;
+
+    /**
+     * The subpackage (relative to <code>targetPackage</code>)
+     * where Torque will put the generated BaseObject, BasePeer,
+     * (and BaseManager, if they are generated at all) Java classes.
+     * If not set, the Base classes will be generated in
+     * <code>targetPackage</code>.
+     *
+     * @parameter
+     */
+    private String subpackageBase;
+
+    /**
+     * The subpackage (relative to <code>targetPackage</code>)
+     * where Torque will put the generated BaseBean Java classes,
+     * if they are generated at all.
+     *
+     * @parameter expression="bean"
+     */
+    private String subpackageBaseBean;
+
+    /**
+     * If true, Torque adds methods to get database fields by name/position.
+     *
+     * @parameter expression="true"
+     */
+    private boolean addGetByNameMethod;
+
+    /**
+     * If true, the data objects will implement a Retrievable interface.
+     *
+     * @parameter expression="false"
+     */
+    private boolean addRetrievableInterface;
+
+    /**
+     * The fully qualified class name of the retrievable interface
+     * to be implemented by the data objects.
+     *
+     * @parameter expression="org.apache.turbine.om.Retrievable"
+     */
+    private String retrievableInterface;
+
+    /**
+     * Determines whether save()-Methods should be added to the data objects.
+     *
+     * @parameter expression="true"
+     */
+    private boolean addSaveMethod;
+
+    /**
+     * Defines which Exception should be thrown by the Object.save() method.
+     *
+     * @parameter expression="Exception"
+     */
+    private String saveException;
+
+    /**
+     * Determines whether a time stamp and a serialVersionUID will be
+     * added to generated objects.
+     *
+     * @parameter expression="true"
+     */
+    private boolean addTimeStamp;
+
+    /**
+     * If true, Torque generates data objects with collection support
+     * and methods to easily retrieve foreign key relationships.
+     *
+     * @parameter expression="true"
+     */
+    private boolean complexObjectModel;
+
+    /**
+     * If true, Torque will generate Manager classes that use JCS for caching.
+     *
+     * @parameter expression="false"
+     */
+    private boolean useManagers;
+
+    /**
+     * If true, Torque generates data objects that cache their foreign key
+     * relationships.
+     *
+     * @parameter expression="true"
+     */
+    private boolean objectIsCaching;
+
+    /**
+     * If true and objectIsCaching is true, Torque silently fetches
+     * foreign key relation collections if the collection is not yet
+     * initialized.
+     *
+     * @parameter expression="true"
+     */
+    private boolean silentDbFetch;
+
+    /**
+     * If true, Torque generates isXXX getter methods for boolean columns.
+     *
+     * @parameter expression="false"
+     */
+    private boolean correctGetters;
+
+    /**
+     * If true, Torque generates a bean object for each data object,
+     * plus methods to convert data objects to beans and vice versa.
+     *
+     * @parameter expression="false"
+     */
+    private boolean generateBeans;
+
+    /**
+     * Whether Java5 generics and iteration shorthand should be used
+     * in generated code.
+     *
+     * @parameter expression="false"
+     */
+    private boolean enableJava5Features;
+
+    /**
+     * Creates a new TorqueOMMojo object.
+     */
+    public OMMojo()
+    {
+    }
+
+    /**
+     * Generates the OM classes for a Torque project and adds them to
+     * the comile sources of the project.
+     *
+     * @throws MojoExecutionException If an error occurs during generation.
+     *
+     * @see TexenTaskMojo#execute()
+     * @see org.apache.maven.plugin.Mojo#execute()
+     */
+    public void execute() throws MojoExecutionException
+    {
+        super.execute();
+
+        try
+        {
+            File outputDirectory = new File(super.getOutputDir());
+            getLog().info ("torque java sources generated into: "
+                    + outputDirectory.getAbsolutePath());
+
+            if (getProject() != null)
+            {
+                getProject().addCompileSourceRoot(outputDirectory.getPath());
+            }
+        }
+        catch (BuildException e)
+        {
+            getLog().error(e.getMessage());
+            throw new MojoExecutionException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * Returns the path to the control template.
+     *
+     * @return "om/Control.vm"
+     */
+    protected String getControlTemplate()
+    {
+        return "om/Control.vm";
+    }
+
+    /**
+     * Returns the context properties for the Texen task.
+     *
+     * @return The PropertiesConfiguration containing all context properties,
+     *         not null.
+     */
+    protected PropertiesConfiguration getMojoContextProperties()
+    {
+        PropertiesConfiguration configuration = new PropertiesConfiguration();
+        configuration.addProperty(
+                TARGET_DATABASE_CONTEXT_PROPERTY,
+                super.getTargetDatabase());
+
+        configuration.addProperty(
+                TARGET_PACKAGE_CONTEXT_PROPERTY,
+                getTargetPackage());
+
+        configuration.addProperty(
+                BASE_PREFIX_CONTEXT_PROPERTY,
+                basePrefix);
+
+        configuration.addProperty(
+                SUBPACKAGE_MAP_CONTEXT_PROPERTY,
+                subpackageMap);
+
+        configuration.addProperty(
+                SUBPACKAGE_BASE_CONTEXT_PROPERTY,
+                subpackageBase);
+
+        configuration.addProperty(
+                SUBPACKAGE_BASE_BEAN_CONTEXT_PROPERTY,
+                subpackageBaseBean);
+
+        configuration.addProperty(
+                SUBPACKAGE_BEAN_CONTEXT_PROPERTY,
+                subpackageBean);
+
+        configuration.addProperty(
+                SUBPACKAGE_MANAGER_CONTEXT_PROPERTY,
+                subpackageManager);
+
+        configuration.addProperty(
+                SUBPACKAGE_OBJECT_CONTEXT_PROPERTY,
+                subpackageObject);
+
+        configuration.addProperty(
+                SUBPACKAGE_PEER_CONTEXT_PROPERTY,
+                subpackagePeer);
+
+        configuration.addProperty(
+                ADD_GET_BY_NAME_METHOD_CONTEXT_PROPERTY,
+                Boolean.toString(addGetByNameMethod));
+
+        configuration.addProperty(
+                ADD_INTAKE_RETRIEVABLE_CONTEXT_PROPERTY,
+                Boolean.toString(addRetrievableInterface));
+
+        configuration.addProperty(
+                RETRIEVABLE_INTERFACE_CONTEXT_PROPERTY,
+                retrievableInterface);
+
+        configuration.addProperty(
+                ADD_SAVE_METHOD_CONTEXT_PROPERTY,
+                Boolean.toString(addSaveMethod));
+
+        configuration.addProperty(
+                ADD_TIME_STAMP_CONTEXT_PROPERTY,
+                Boolean.toString(addTimeStamp));
+
+        configuration.addProperty(
+                BEAN_SUFFIX_CONTEXT_PROPERTY,
+                beanSuffix);
+
+        configuration.addProperty(
+                GENERATE_BEANS_CONTEXT_PROPERTY,
+                Boolean.toString(generateBeans));
+
+        configuration.addProperty(
+                COMPLEX_OBJECT_MODEL_CONTEXT_PROPERTY,
+                Boolean.toString(complexObjectModel));
+
+        configuration.addProperty(
+                CORRECT_GETTERS_CONTEXT_PROPERTY,
+                Boolean.toString(correctGetters));
+
+        configuration.addProperty(
+                ENABLE_JAVA_5_FEATURES_CONTEXT_PROPERTY,
+                Boolean.toString(correctGetters));
+
+        configuration.addProperty(
+                OBJECT_IS_CACHING_CONTEXT_PROPERTY,
+                Boolean.toString(objectIsCaching));
+
+        configuration.addProperty(
+                SAVE_EXCEPTION_CONTEXT_PROPERTY,
+                saveException);
+
+        configuration.addProperty(
+                SILENT_DB_FETCH_CONTEXT_PROPERTY,
+                Boolean.toString(silentDbFetch));
+
+        configuration.addProperty(
+                USE_MANAGERS_CONTEXT_PROPERTY,
+                Boolean.toString(useManagers));
+
+        return configuration;
+    }
+
+    /**
+     * Returns the prefix for the base classes.
+     *
+     * @return the prefix for the base classes.
+     */
+    public String getBasePrefix()
+    {
+        return basePrefix;
+    }
+
+    /**
+     * Sets the prefix for the names of the base classes.
+     *
+     * @param basePrefix the prefix for the base classes.
+     */
+    public void setBasePrefix(String basePrefix)
+    {
+        this.basePrefix = basePrefix;
+    }
+
+    /**
+     * Returns the suffix for the names of the bean classes.
+     *
+     * @return the suffix for the bean classes.
+     */
+    public String getBeanSuffix()
+    {
+        return beanSuffix;
+    }
+
+    /**
+     * Sets the suffix for the names of the bean classes.
+     *
+     * @param beanSuffix the suffix for the bean classes.
+     */
+    public void setBeanSuffix(String beanSuffix)
+    {
+        this.beanSuffix = beanSuffix;
+    }
+
+    /**
+     * Gets the subpackage for the database map classes.
+     *
+     * @return the subpackage for the database map classes.
+     */
+    public String getSubpackageMap()
+    {
+        return subpackageMap;
+    }
+
+    /**
+     * Sets the subpackage for the database map classes.
+     *
+     * @param subpackageMap the subpackage for the database map classes.
+     */
+    public void setSubpackageMap(String subpackageMap)
+    {
+        this.subpackageMap = subpackageMap;
+    }
+
+    /**
+     * Gets the subpackage for the base Object, Peer, and Manager classes.
+     *
+     * @return the subpackage for the base Object, Peer, and Manager classes,
+     *         or null if not set.
+     */
+    public String getSubpackageBase()
+    {
+        return subpackageBase;
+    }
+
+    /**
+     * Sets the subpackage for the base Object, Peer, and Manager classes.
+     *
+     * @param subpackageBase the subpackage for the base Object, Peer,
+     *        and Manager classes.
+     */
+    public void setSubpackageBase(String subpackageBase)
+    {
+        this.subpackageBase = subpackageBase;
+    }
+
+    /**
+     * Gets the subpackage for the base peer, object, and manager classes.
+     *
+     * @return the subpackage for the base peer, object, and manager classes,
+     *         or null if not set.
+     */
+    public String getSubpackageBaseBean()
+    {
+        return subpackageBaseBean;
+    }
+
+    /**
+     * Sets the subpackage for the base bean classes.
+     *
+     * @param subpackageBaseBean the subpackage for the base bean classes.
+     */
+    public void setSubpackageBaseBean(String subpackageBaseBean)
+    {
+        this.subpackageBaseBean = subpackageBaseBean;
+    }
+
+    /**
+     * Gets the subpackage for the bean classes.
+     *
+     * @return the subpackage for the bean classes.
+     */
+    public String getSubpackageBean()
+    {
+        return subpackageBean;
+    }
+
+    /**
+     * Sets the subpackage for the bean classes.
+     *
+     * @param subpackageBean the subpackage for the bean classes.
+     */
+    public void setSubpackageBean(String subpackageBean)
+    {
+        this.subpackageBean = subpackageBean;
+    }
+
+    /**
+     * Gets the subpackage for the manager classes.
+     *
+     * @return the subpackage for the manager classes, or null if not set.
+     */
+    public String getSubpackageManager()
+    {
+        return subpackageManager;
+    }
+
+    /**
+     * Sets the subpackage for the manager classes.
+     *
+     * @param subpackageManager the subpackage for the manager classes.
+     */
+    public void setSubpackageManager(String subpackageManager)
+    {
+        this.subpackageManager = subpackageManager;
+    }
+
+    /**
+     * Gets the subpackage for the data object classes.
+     *
+     * @return the subpackage for the data object classes.
+     */
+    public String getSubpackageObject()
+    {
+        return subpackageObject;
+    }
+
+    /**
+     * Sets the subpackage for the data object classes.
+     *
+     * @param subpackageObject the subpackage for the data object classes.
+     */
+    public void setSubpackageObject(String subpackageObject)
+    {
+        this.subpackageObject = subpackageObject;
+    }
+
+    /**
+     * Gets the subpackage for the peer classes.
+     *
+     * @return the subpackage for the peer classes, or null if not set.
+     */
+    public String getSubpackagePeer()
+    {
+        return subpackagePeer;
+    }
+
+    /**
+     * Sets the subpackage for the peer classes.
+     *
+     * @param subpackagePeer the subpackage for the peer classes.
+     */
+    public void setSubpackagePeer(String subpackagePeer)
+    {
+        this.subpackagePeer = subpackagePeer;
+    }
+
+    /**
+     * Returns whether Torque adds methods to get database fields
+     * by name/position.
+     *
+     * @return true if Torque adds methods to get database fields
+     *         by name/position, false otherwise.
+     */
+    public boolean isAddGetByNameMethod()
+    {
+        return addGetByNameMethod;
+    }
+
+    /**
+     * Sets whether Torque should add methods to get database fields
+     * by name/position.
+     *
+     * @param addGetByNameMethod whether Torque should add methods to get
+     *        database fields by name/position.
+     */
+    public void setAddGetByNameMethod(boolean addGetByNameMethod)
+    {
+        this.addGetByNameMethod = addGetByNameMethod;
+    }
+
+    /**
+     * Returns whether the data objects will implement an Retrievable interface.
+     *
+     * @return true if the data objects will implement an Retrievable interface,
+     *         false otherwise.
+     */
+    public boolean isAddRetrievableInterface()
+    {
+        return addRetrievableInterface;
+    }
+
+    /**
+     * Sets whether the data objects should implement an Retrievable interface.
+     *
+     * @param addRetrievableInterface whether the data objects should implement
+     *        a Retrievable interface.
+     */
+    public void setAddRetrievableInterface(boolean addRetrievableInterface)
+    {
+        this.addRetrievableInterface = addRetrievableInterface;
+    }
+
+    /**
+     * Returns whether Torque will add save methods to the data objects.
+     *
+     * @return true if Torque will add save methods to the data objects,
+     *         false otherwise.
+     */
+    public boolean isAddSaveMethod()
+    {
+        return addSaveMethod;
+    }
+
+    /**
+     * Sets whether Torque should add save methods to the data objects.
+     *
+     * @param addSaveMethod whether Torque should add save methods to the
+     *        data objects.
+     */
+    public void setAddSaveMethod(boolean addSaveMethod)
+    {
+        this.addSaveMethod = addSaveMethod;
+    }
+
+    /**
+     * Returns whether Torque puts time stamps in generated om files.
+     *
+     * @return true if Torque puts time stamps in generated om files,
+     *         false otherwise.
+     */
+    public boolean isAddTimeStamp()
+    {
+        return addTimeStamp;
+    }
+
+    /**
+     * Sets whether Torque puts time stamps in generated om files.
+     *
+     * @param addTimeStamp whether Torque puts time stamps in generated
+     *        om files.
+     */
+    public void setAddTimeStamp(boolean addTimeStamp)
+    {
+        this.addTimeStamp = addTimeStamp;
+    }
+
+    /**
+     * Returns whether Torque generates data objects with collection support
+     * and methods to easily retrieve foreign key relationships.
+     *
+     * @return true if Torque generates data objects with collection support
+     *         and methods to easily retrieve foreign key relationships,
+     *         false otherwise.
+     */
+    public boolean isComplexObjectModel()
+    {
+        return complexObjectModel;
+    }
+
+    /**
+     * Sets whether Torque generates data objects with collection support
+     * and methods to easily retrieve foreign key relationships.
+     *
+     * @param complexObjectModel whether Torque generates data objects
+     *        with collection support and methods to easily retrieve
+     *        foreign key relationships, false otherwise.
+     */
+    public void setComplexObjectModel(boolean complexObjectModel)
+    {
+        this.complexObjectModel = complexObjectModel;
+    }
+
+    /**
+     * Returns whether Torque generates isXXX getter methods for boolean
+     * columns.
+     *
+     * @return true if Torque generates isXXX getter methods for boolean
+     *         columns, false if Torque generates getXXX getter methods
+     *         for boolean columns.
+     */
+    public boolean isCorrectGetters()
+    {
+        return correctGetters;
+    }
+
+    /**
+     * Sets whether Torque generates isXXX getter methods for boolean
+     * columns.
+     *
+     * @param correctGetters true if Torque generates isXXX getter methods
+     *        for boolean columns, false if Torque generates getXXX getter
+     *        methods for boolean columns.
+     */
+    public void setCorrectGetters(boolean correctGetters)
+    {
+        this.correctGetters = correctGetters;
+    }
+
+    /**
+     * Returns whether Java5 generics and iteration shorthand will be used
+     * in generated code.
+     *
+     * @return true if Java5 generics and iteration shorthand will be used
+     *         in generated code, false to generate 1.4-compliant code.
+     */
+    public boolean isEnableJava5Features()
+    {
+        return enableJava5Features;
+    }
+
+    /**
+     * Sets whether Java5 generics and iteration shorthand should be used
+     * in generated code.
+     *
+     * @param enableJava5Features true if Java5 generics and iteration
+     *        shorthand will be used in generated code, false to generate
+     *        1.4-compliant code.
+     */
+    public void setEnableJava5Features(boolean enableJava5Features)
+    {
+        this.enableJava5Features = enableJava5Features;
+    }
+
+    /**
+     * Returns  whether bean classes will be generated.
+     *
+     * @return true if bean classes will be generated, false otherwise.
+     */
+    public boolean isGenerateBeans()
+    {
+        return generateBeans;
+    }
+
+    /**
+     * Sets whether bean classes should be generated.
+     *
+     * @param generateBeans whether bean classes should be generated.
+     */
+    public void setGenerateBeans(boolean generateBeans)
+    {
+        this.generateBeans = generateBeans;
+    }
+
+    /**
+     * Returns whether data objects cache their foreign key relationships.
+     *
+     * @return true if data objects cache their foreign key relationships,
+     *         false otherwise.
+     */
+    public boolean isObjectIsCaching()
+    {
+        return objectIsCaching;
+    }
+
+    /**
+     * Sets whether data objects cache their foreign key relationships.
+     *
+     * @param objectIsCaching true if data objects cache their
+     *        foreign key relationships, false otherwise.
+     */
+    public void setObjectIsCaching(boolean objectIsCaching)
+    {
+        this.objectIsCaching = objectIsCaching;
+    }
+
+    /**
+     * Returns the fully qualified class name of the Retrievable interface
+     * which should be implemented by the generated data objects.
+     *
+     * @return the fully qualified class name of the Retrievable interface.
+     */
+    public String getRetrievableInterface()
+    {
+        return retrievableInterface;
+    }
+
+    /**
+     * Sets the fully qualified class name of the Retrievable interface
+     * which should be implemented by the generated data objects.
+     *
+     * @param retrievableInterface the fully qualified class name of the
+     *        Retrievable interface.
+     */
+    public void setRetrievableInterface(String retrievableInterface)
+    {
+        this.retrievableInterface = retrievableInterface;
+    }
+
+    /**
+     * Returns the class name of the Exception which should be thrown
+     * by the save methods of the generated data objects.
+     *
+     * @return the class name of the Exception which should be thrown
+     *         by the generated save methods.
+     */
+    public String getSaveException()
+    {
+        return saveException;
+    }
+
+    /**
+     * Sets the class name of the Exception which should be thrown
+     * by the save methods of the generated data objects.
+     *
+     * @param saveException the class name of the Exception
+     *        which should be thrown by the generated save methods.
+     */
+    public void setSaveException(String saveException)
+    {
+        this.saveException = saveException;
+    }
+
+    /**
+     * Returns whether Torque silently fetches foreign key relation collections
+     * if the collection is not yet initialized.
+     *
+     * @return true if Torque silently fetches foreign key relation collections
+     *         if the collection is not yet initialized, false otherwise.
+     */
+    public boolean isSilentDbFetch()
+    {
+        return silentDbFetch;
+    }
+
+    /**
+     * Sets whether Torque should silently fetches foreign key relation
+     * collections if the collection is not yet initialized.
+     *
+     * @param silentDbFetch whether Torque should silently fetch
+     *        foreign key relation collections if the collection
+     *        is not yet initialized.
+     */
+    public void setSilentDbFetch(boolean silentDbFetch)
+    {
+        this.silentDbFetch = silentDbFetch;
+    }
+
+    /**
+     * Returns whether Torque will generate Manager classes that use JCS
+     * for caching.
+     *
+     * @return true if Torque will generate Manager classes that use JCS
+     *         for caching, false otherwise.
+     */
+    public boolean isUseManagers()
+    {
+        return useManagers;
+    }
+
+    /**
+     * Sets whether Torque should generate Manager classes that use JCS
+     * for caching.
+     *
+     * @param useManagers whether Torque should generate Manager classes
+     *        that use JCS for caching.
+     */
+    public void setUseManagers(boolean useManagers)
+    {
+        this.useManagers = useManagers;
+    }
+}

Modified: db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java?view=diff&rev=473817&r1=473816&r2=473817
==============================================================================
--- db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java (original)
+++ db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java Sat Nov 11 14:32:42 2006
@@ -1,351 +1,354 @@
-package org.apache.torque.mojo;
-
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.tools.ant.Project;
-import org.apache.torque.task.TorqueSQLExec;
-import org.apache.torque.task.TorqueSQLExec.OnError;
-
-/**
- * Executes the generated SQL.
- *
- * @author Raphael Pieroni (rafale_at_codehaus.org)
- * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
- *
- * @goal sqlExec
- * @phase generate-sources
- */
-public class SqlExecMojo
-    extends AbstractMojo
-{
-    /**
-     * The ant task this mojo is wrapping.
-     */
-    private TorqueSQLExec antTask = new TorqueSQLExec();
-
-    /**
-     * The ant project the ant task is running in.
-     */
-    private Project antProject = new Project();
-
-    /**
-     * Autocommit flag. Default value is false.
-     *
-     * @parameter expression="false"
-     */
-    private boolean autocommit = false;
-
-    /**
-     * Tells the Mojo what to do if an sql error occurs during execution.
-     * Can be either "continue", "stop" or "abort".
-     *
-     * @parameter expression="continue".
-     * @required
-     */
-    private String onError;
-
-    /**
-     * The fully qualified class name of the database driver.
-     *
-     * @parameter
-     * @required
-     */
-    private String driver = null;
-
-    /**
-     * The connect URL of the database.
-     *
-     * @parameter
-     * @required
-     */
-    private String url = null;
-
-    /**
-     * The user name to connect to the database.
-     *
-     * @parameter
-     * @required
-     */
-    private String user = null;
-
-    /**
-     * The password for the database user.
-     *
-     * @parameter
-     * @required
-     */
-    private String password = null;
-
-    /**
-     * The SQL Statement delimiter.
-     *
-     * @parameter expression=";"
-     */
-    private String delimiter = ";";
-
-    /**
-     * The path to the properties file containing the mapping
-     * sql file -> target database.
-     *
-     * @parameter expression="${project.build.directory}/torque/sqldbmap.properties"
-     */
-    private String sqlDbMap;
-
-    /**
-     * The source directory where to find the SQL files.
-     *
-     * @parameter expression="${project.build.directory}/generated-sql/torque"
-     */
-    private String srcDir;
-
-    /**
-     * Creates and initializes a SqlExecMojo.
-     */
-    public SqlExecMojo()
-    {
-        antProject.init();
-        antTask.setProject(antProject);
-    }
-
-    /**
-     * Returns whether autocommit is turned on.
-     *
-     * @return true if autocommit is on, false otherwise.
-     */
-    public boolean isAutocommit()
-    {
-        return autocommit;
-    }
-
-    /**
-     * Sets whether autocommit is turned on.
-     *
-     * @param autocommit true to turn autocommit on, false to turn it off.
-     */
-    public void setAutocommit(boolean autocommit)
-    {
-        this.autocommit = autocommit;
-    }
-
-    /**
-     * The delimiter used to separate SQL commands.
-     *
-     * @return the delimiter used to separate SQL commands.
-     */
-    public String getDelimiter()
-    {
-        return delimiter;
-    }
-
-    /**
-     * Sets the delimiter used to separate SQL commands.
-     *
-     * @param delimiter the delimiter used to separate SQL commands.
-     */
-    public void setDelimiter(String delimiter)
-    {
-        this.delimiter = delimiter;
-    }
-
-    /**
-     * Returns the fully qualified class name of the database driver.
-     *
-     * @return the fully qualified class name of the database driver.
-     */
-    public String getDriver()
-    {
-        return driver;
-    }
-
-    /**
-     * Sets the fully qualified class name of the database driver.
-     *
-     * @param driver the fully qualified class name of the database driver.
-     */
-    public void setDriver(String driver)
-    {
-        this.driver = driver;
-    }
-
-    /**
-     * Returns the password of the database user.
-     *
-     * @return the password of the database user.
-     */
-    public String getPassword()
-    {
-        return password;
-    }
-
-    /**
-     * Sets the password of the database user.
-     *
-     * @param password the password of the database user.
-     */
-    public void setPassword(String password)
-    {
-        this.password = password;
-    }
-
-    /**
-     * Returns the connect URL to the database.
-     *
-     * @return the connect URL to the database.
-     */
-    public String getUrl()
-    {
-        return url;
-    }
-
-    /**
-     * Sets the connect URL to the database.
-     *
-     * @param url the connect URL to the database.
-     */
-    public void setUrl(String url)
-    {
-        this.url = url;
-    }
-
-    /**
-     * Returns the database user.
-     *
-     * @return the userId of the database user.
-     */
-    public String getUser()
-    {
-        return user;
-    }
-
-    /**
-     * Sets the database user.
-     *
-     * @param user the userId of the database user.
-     */
-    public void setUser(String user)
-    {
-        this.user = user;
-    }
-
-    /**
-     * Returns the path to the mapping SQL Files -> database.
-     *
-     * @return the path to the mapping SQL Files -> database.
-     */
-    public String getSqlDbMap()
-    {
-        return sqlDbMap;
-    }
-
-    /**
-     * Sets the path to the mapping SQL Files -> database.
-     *
-     * @param sqlDbMap the absolute path to the mapping SQL Files -> database.
-     */
-    public void setSqlDbMap(String sqlDbMap)
-    {
-        this.sqlDbMap = sqlDbMap;
-    }
-
-    /**
-     * Returns whether to procede if an sql error occurs
-     * during execution.
-     *
-     * @return onError what to do in case of an sql error, can be one of
-     *         "continue", "stop" or "abort".
-     */
-    public String getOnError()
-    {
-        return onError;
-    }
-
-    /**
-     * Tells the task whether to procede if an sql error occurs
-     * during execution.
-     * Can be either "continue", "stop" or "abort".
-     *
-     * @param onError what to do in case of an sql error.
-     */
-    public void setOnError(String onError)
-    {
-        this.onError = onError;
-    }
-
-    /**
-     * Returns the path to the directory where the sql files can be found.
-     *
-     * @return the source directory where to find the SQL files.
-     */
-    public String getSrcDir()
-    {
-        return srcDir;
-    }
-
-    /**
-     * Sets the path to the directory where the sql files can be found.
-     *
-     * @param srcDir the source directory where to find the SQL files.
-     */
-    public void setSrcDir(String srcDir)
-    {
-        this.srcDir = srcDir;
-    }
-
-    /**
-     * Executes the goal of this mojo.
-     *
-     * @throws MojoExecutionException if the execution fails.
-     *
-     * @see org.apache.maven.plugin.Mojo#execute()
-     */
-    public void execute() throws MojoExecutionException
-    {
-        configureTask();
-        antTask.execute();
-    }
-
-    /**
-     * Transfers the settings in this Mojo to the encapsulated ant task.
-     */
-    protected void configureTask()
-    {
-        antTask.setDelimiter(getDelimiter());
-        antTask.setAutocommit(isAutocommit());
-        antTask.setDriver(getDriver());
-        antTask.setUrl(getUrl());
-        antTask.setUserid(getUser());
-        antTask.setPassword(getPassword());
-        antTask.setSqlDbMap(getSqlDbMap());
-        antTask.setSrcDir(getSrcDir());
-        getLog().info("SQL src dir: " + getSrcDir());
-        antTask.setOnerror(getOnErrorAction());
-    }
-
-    /**
-     * Returns the onError setting as a OnError object.
-     *
-     * @return the onError setting as a OnError object, never null.
-     */
-    private OnError getOnErrorAction()
-    {
-        OnError onErrorAction = new OnError();
-        onErrorAction.setValue(onError);
-        return onErrorAction;
-    }
-}
+package org.apache.torque.mojo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.tools.ant.Project;
+import org.apache.torque.task.TorqueSQLExec;
+import org.apache.torque.task.TorqueSQLExec.OnError;
+
+/**
+ * Executes the generated SQL.
+ *
+ * @author Raphael Pieroni (rafale_at_codehaus.org)
+ * @author <a href="fischer@seitenbau.de">Thomas Fischer</a>
+ *
+ * @goal sqlExec
+ * @phase generate-sources
+ */
+public class SqlExecMojo
+    extends AbstractMojo
+{
+    /**
+     * The ant task this mojo is wrapping.
+     */
+    private TorqueSQLExec antTask = new TorqueSQLExec();
+
+    /**
+     * The ant project the ant task is running in.
+     */
+    private Project antProject = new Project();
+
+    /**
+     * Autocommit flag. Default value is false.
+     *
+     * @parameter expression="false"
+     */
+    private boolean autocommit = false;
+
+    /**
+     * Tells the Mojo what to do if an sql error occurs during execution.
+     * Can be either "continue", "stop" or "abort".
+     *
+     * @parameter expression="continue".
+     * @required
+     */
+    private String onError;
+
+    /**
+     * The fully qualified class name of the database driver.
+     *
+     * @parameter
+     * @required
+     */
+    private String driver = null;
+
+    /**
+     * The connect URL of the database.
+     *
+     * @parameter
+     * @required
+     */
+    private String url = null;
+
+    /**
+     * The user name to connect to the database.
+     *
+     * @parameter
+     * @required
+     */
+    private String user = null;
+
+    /**
+     * The password for the database user.
+     *
+     * @parameter
+     * @required
+     */
+    private String password = null;
+
+    /**
+     * The SQL Statement delimiter.
+     *
+     * @parameter expression=";"
+     */
+    private String delimiter = ";";
+
+    /**
+     * The path to the properties file containing the mapping
+     * sql file -> target database.
+     *
+     * @parameter expression="${project.build.directory}/torque/sqldbmap.properties"
+     */
+    private String sqlDbMap;
+
+    /**
+     * The source directory where to find the SQL files.
+     *
+     * @parameter expression="${project.build.directory}/generated-sql/torque"
+     */
+    private String srcDir;
+
+    /**
+     * Creates and initializes a SqlExecMojo.
+     */
+    public SqlExecMojo()
+    {
+        antProject.init();
+        antTask.setProject(antProject);
+    }
+
+    /**
+     * Returns whether autocommit is turned on.
+     *
+     * @return true if autocommit is on, false otherwise.
+     */
+    public boolean isAutocommit()
+    {
+        return autocommit;
+    }
+
+    /**
+     * Sets whether autocommit is turned on.
+     *
+     * @param autocommit true to turn autocommit on, false to turn it off.
+     */
+    public void setAutocommit(boolean autocommit)
+    {
+        this.autocommit = autocommit;
+    }
+
+    /**
+     * The delimiter used to separate SQL commands.
+     *
+     * @return the delimiter used to separate SQL commands.
+     */
+    public String getDelimiter()
+    {
+        return delimiter;
+    }
+
+    /**
+     * Sets the delimiter used to separate SQL commands.
+     *
+     * @param delimiter the delimiter used to separate SQL commands.
+     */
+    public void setDelimiter(String delimiter)
+    {
+        this.delimiter = delimiter;
+    }
+
+    /**
+     * Returns the fully qualified class name of the database driver.
+     *
+     * @return the fully qualified class name of the database driver.
+     */
+    public String getDriver()
+    {
+        return driver;
+    }
+
+    /**
+     * Sets the fully qualified class name of the database driver.
+     *
+     * @param driver the fully qualified class name of the database driver.
+     */
+    public void setDriver(String driver)
+    {
+        this.driver = driver;
+    }
+
+    /**
+     * Returns the password of the database user.
+     *
+     * @return the password of the database user.
+     */
+    public String getPassword()
+    {
+        return password;
+    }
+
+    /**
+     * Sets the password of the database user.
+     *
+     * @param password the password of the database user.
+     */
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+
+    /**
+     * Returns the connect URL to the database.
+     *
+     * @return the connect URL to the database.
+     */
+    public String getUrl()
+    {
+        return url;
+    }
+
+    /**
+     * Sets the connect URL to the database.
+     *
+     * @param url the connect URL to the database.
+     */
+    public void setUrl(String url)
+    {
+        this.url = url;
+    }
+
+    /**
+     * Returns the database user.
+     *
+     * @return the userId of the database user.
+     */
+    public String getUser()
+    {
+        return user;
+    }
+
+    /**
+     * Sets the database user.
+     *
+     * @param user the userId of the database user.
+     */
+    public void setUser(String user)
+    {
+        this.user = user;
+    }
+
+    /**
+     * Returns the path to the mapping SQL Files -> database.
+     *
+     * @return the path to the mapping SQL Files -> database.
+     */
+    public String getSqlDbMap()
+    {
+        return sqlDbMap;
+    }
+
+    /**
+     * Sets the path to the mapping SQL Files -> database.
+     *
+     * @param sqlDbMap the absolute path to the mapping SQL Files -> database.
+     */
+    public void setSqlDbMap(String sqlDbMap)
+    {
+        this.sqlDbMap = sqlDbMap;
+    }
+
+    /**
+     * Returns whether to procede if an sql error occurs
+     * during execution.
+     *
+     * @return onError what to do in case of an sql error, can be one of
+     *         "continue", "stop" or "abort".
+     */
+    public String getOnError()
+    {
+        return onError;
+    }
+
+    /**
+     * Tells the task whether to procede if an sql error occurs
+     * during execution.
+     * Can be either "continue", "stop" or "abort".
+     *
+     * @param onError what to do in case of an sql error.
+     */
+    public void setOnError(String onError)
+    {
+        this.onError = onError;
+    }
+
+    /**
+     * Returns the path to the directory where the sql files can be found.
+     *
+     * @return the source directory where to find the SQL files.
+     */
+    public String getSrcDir()
+    {
+        return srcDir;
+    }
+
+    /**
+     * Sets the path to the directory where the sql files can be found.
+     *
+     * @param srcDir the source directory where to find the SQL files.
+     */
+    public void setSrcDir(String srcDir)
+    {
+        this.srcDir = srcDir;
+    }
+
+    /**
+     * Executes the goal of this mojo.
+     *
+     * @throws MojoExecutionException if the execution fails.
+     *
+     * @see org.apache.maven.plugin.Mojo#execute()
+     */
+    public void execute() throws MojoExecutionException
+    {
+        configureTask();
+        antTask.execute();
+    }
+
+    /**
+     * Transfers the settings in this Mojo to the encapsulated ant task.
+     */
+    protected void configureTask()
+    {
+        antTask.setDelimiter(getDelimiter());
+        antTask.setAutocommit(isAutocommit());
+        antTask.setDriver(getDriver());
+        antTask.setUrl(getUrl());
+        antTask.setUserid(getUser());
+        antTask.setPassword(getPassword());
+        antTask.setSqlDbMap(getSqlDbMap());
+        antTask.setSrcDir(getSrcDir());
+        getLog().info("SQL src dir: " + getSrcDir());
+        antTask.setOnerror(getOnErrorAction());
+    }
+
+    /**
+     * Returns the onError setting as a OnError object.
+     *
+     * @return the onError setting as a OnError object, never null.
+     */
+    private OnError getOnErrorAction()
+    {
+        OnError onErrorAction = new OnError();
+        onErrorAction.setValue(onError);
+        return onErrorAction;
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message