Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2212

cdbimport cleanup and configuration schema refactoring

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.M5
    • Component/s: Non-GUI Tools
    • Labels:
      None

      Description

      cdbimport Maven plugin (and Ant task) has many small problems with naming, configuration schema and code organization. That leads to confusion when configuring or maintaining it.
      So several tasks should be done to improve usability of this tools.

      Main braking change is the new XML schema for configuration:

      <plugin>
          <artifactId>maven-cayenne-plugin</artifactId>
          <configuration>
              <map>test.map.xml</map>
              <adapter>org.apache.cayenne.dba.derby.DerbyAdapter</adapter>
              <!-- Group all data-source related fields, they can later be unified with data-source configured in project's DataNode -->
              <dataSource>
                  <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
                  <url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
                  <username>cayenne</username>
                  <password>cayenne</password>
              </dataSource>
              
              <!-- Rename reverseEngineering to dbimport -->
              <dbimport>
                  <!-- Flag to control Date and Time types, new default will be java8 types -->
                  <useJava7Types>true</useJava7Types>
      
                  <!-- move all other top level settings here -->
                  <skipRelationshipsLoading>false</skipRelationshipsLoading>
                  <forceDataMapCatalog>true</forceDataMapCatalog>
                  <usePrimitives>false</usePrimitives>
                   
                  <meaningfulPkTables>table1,table2,table3</meaningfulPkTables>
      
                  <catalog>
                      <name>TEST_CATALOG</name>
                     <!-- remove confusing plural forms of tags (like includeTables) -->
                      <includeTable>
                          <pattern>table1</pattern>
                          <excludeColumn>.*XYZ</excludeColumn>
                      </includeTable>
                      <includeTable>table2</includeTable>
                      <includeTable>table3</includeTable>
                  </catalog>
      
                  <schema>
                      <name>TEST_SCHEMA</name>
                  </schema>
              </dbimport>
          </configuration>
      </plugin>
      

        Attachments

          Activity

            People

            • Assignee:
              ntimofeev Nikita Timofeev
              Reporter:
              ntimofeev Nikita Timofeev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: