Package org.apache.torque.generator.source.jdbc

## Class JdbcMetadataSourceProvider

- java.lang.Object
- - org.apache.torque.generator.source.SourceProvider
  - - org.apache.torque.generator.source.jdbc.JdbcMetadataSourceProvider

- All Implemented Interfaces:
    `Iterator<Source>`

      public class JdbcMetadataSourceProvider
      extends SourceProvider

  Creates a source from JDBC metadata.
  Version:
    $Id: JdbcMetadataSourceProvider.java 1850967 2019-01-10 17:54:13Z painter $

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JdbcMetadataSourceProvider​(String urlOption, String driverOption, String usernameOption, String passwordOption, String schemaOption)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SourceProvider` | `copy()` | Returns a copy of this source provider in its initial state.
    `void` | `copyNotSetSettingsFrom​(SourceProvider sourceProvider)` | Copies settings which are not set in this source provider from another source provider.
    `String` | `getDriver()` |
    `String` | `getDriverOption()` |
    `String` | `getPassword()` |
    `String` | `getPasswordOption()` |
    `String` | `getSchema()` |
    `String` | `getSchemaOption()` |
    `String` | `getUrl()` |
    `String` | `getUrlOption()` |
    `String` | `getUsername()` |
    `String` | `getUsernameOption()` |
    `boolean` | `hasNext()` |
    `void` | `initInternal​(ConfigurationHandlers configurationHandlers, ControllerState controllerState)` | Initializes the sources provided by this SourceProvider.
    `Source` | `next()` |
    `void` | `remove()` |
    `protected void` | `resetInternal​(ConfigurationHandlers configurationHandlers, ControllerState controllerState)` | Resets the sources provided by this SourceProvider.

    - ### Methods inherited from class org.apache.torque.generator.source.SourceProvider

      `init, isInit, reset`

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

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

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Constructor Detail

    - #### JdbcMetadataSourceProvider

          public JdbcMetadataSourceProvider​(String urlOption,
                                            String driverOption,
                                            String usernameOption,
                                            String passwordOption,
                                            String schemaOption)
                                     throws ConfigurationException

      Throws:
        `ConfigurationException`

  - ### Method Detail

    - #### initInternal

          public void initInternal​(ConfigurationHandlers configurationHandlers,
                                   ControllerState controllerState)
                            throws ConfigurationException

      Description copied from class: `SourceProvider`
      Initializes the sources provided by this SourceProvider.
      Specified by:
        `initInternal` in class `SourceProvider`
      Parameters:
        `configurationHandlers` - the configuration handlers, not null.
        `controllerState` - the current controller state, not null.
      Throws:
        `ConfigurationException` - if initializing fails.

    - #### hasNext

          public boolean hasNext()

    - #### next

          public Source next()

    - #### resetInternal

          protected void resetInternal​(ConfigurationHandlers configurationHandlers,
                                       ControllerState controllerState)
                                throws ConfigurationException

      Description copied from class: `SourceProvider`
      Resets the sources provided by this SourceProvider.
      Specified by:
        `resetInternal` in class `SourceProvider`
      Parameters:
        `configurationHandlers` - the configuration handlers, not null.
        `controllerState` - the current controller state, not null.
      Throws:
        `ConfigurationException` - if resetting fails.

    - #### remove

          public void remove()

    - #### getUrlOption

          public String getUrlOption()

    - #### getDriverOption

          public String getDriverOption()

    - #### getUsernameOption

          public String getUsernameOption()

    - #### getPasswordOption

          public String getPasswordOption()

    - #### getSchemaOption

          public String getSchemaOption()

    - #### getUrl

          public String getUrl()

    - #### getDriver

          public String getDriver()

    - #### getUsername

          public String getUsername()

    - #### getPassword

          public String getPassword()

    - #### getSchema

          public String getSchema()

    - #### copy

          public SourceProvider copy()
                              throws ConfigurationException

      Returns a copy of this source provider in its initial state. This means the `SourceProvider.init(ConfigurationHandlers, ControllerState)` method of the new source provider must be called before it can be used.
      Specified by:
        `copy` in class `SourceProvider`
      Returns:
        the SourceProvider
      Throws:
        `ConfigurationException` - if the new SourceProvider cannot be initialized.

    - #### copyNotSetSettingsFrom

          public void copyNotSetSettingsFrom​(SourceProvider sourceProvider)

      Copies settings which are not set in this source provider from another source provider. This only works if the type of the other source provider is known to this source provider. Only a subset of all properties are typically used for overwriting. No Properties which are already set are overwritten.
      Specified by:
        `copyNotSetSettingsFrom` in class `SourceProvider`
      Parameters:
        `sourceProvider` - the source provoder to copy the settings from.