org.apache.torque.templates.transformer.om.mapInit

## Class DatabaseMapInitTransformer

- java.lang.Object
- - org.apache.torque.generator.source.transform.AttributeTransformer
  - - org.apache.torque.templates.transformer.om.mapInit.DatabaseMapInitTransformer

- All Implemented Interfaces:
    SourceTransformer

      public class DatabaseMapInitTransformer
      extends AttributeTransformer

  A transformer providing extra attributes for the generation of the mapInit classes. It collects all tables for a database with the same name and also sets attributes needed for java generation.
  Version:
    $Id: DatabaseMapInitTransformer.java 1840416 2018-09-09 15:10:22Z tv $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatabaseMapInitTransformer()` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `setDatabaseMapInitClassNameAttributes(SourceElement sourceElement, String databaseName, ControllerState controllerState)` Sets the databaseMapInitClassName and baseDatabaseMapInitClassName attributes on a source element.
    `SourceElement` | `transform(Object modelRoot, ControllerState controllerState)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DatabaseMapInitTransformer

          public DatabaseMapInitTransformer()
                                     throws SourceTransformerException

      Constructor.
      Throws:
        `SourceTransformerException` - if the attribute map is malformed.

  - ### Method Detail

    - #### transform

          public SourceElement transform(Object modelRoot,
                                         ControllerState controllerState)
                                  throws SourceTransformerException

      Specified by:
        `transform` in interface `SourceTransformer`
      Overrides:
        `transform` in class `AttributeTransformer`
      Throws:
        `SourceTransformerException`

    - #### setDatabaseMapInitClassNameAttributes

          public static void setDatabaseMapInitClassNameAttributes(SourceElement sourceElement,
                                                                   String databaseName,
                                                                   ControllerState controllerState)

      Sets the databaseMapInitClassName and baseDatabaseMapInitClassName attributes on a source element.
      Parameters:
        `sourceElement` - the element where the attribute should be set, not null.
        `databaseName` - the name of the database element, not null.
        `controllerState` - the controller state, not null.

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.