OpenJPA
  1. OpenJPA
  2. OPENJPA-1605

ReverseMappingTool (SchemaGenerator) bug

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta3
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      org.apache.openjpa.jdbc.schema.SchemaGenerator.java
      =============================================
      ...
      ...
      public void generateTables(DBIdentifier schemaName, DBIdentifier tableName,
      Connection conn, DatabaseMetaData meta) {
      ...
      Table table;
      DBIdentifier tableSchema = DBIdentifier.NULL;
      for (int i = 0; cols != null && i < cols.length; i++) {
      if (DBIdentifier.isNull(tableName) || tableName.equals("%"))

      { <--- bug code line tableName = cols[i].getTableIdentifier(); <--- bug code line }

      ...
      ...
      }
      }

      if parameter tableName is null, than tableName is always been set the first column table Identifier
      --> "cols[0].getTableIdentifier() "
      this cause only generate first table class file with wrong columns.

        Issue Links

          Activity

          Donald Woods made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Donald Woods made changes -
          Fix Version/s 2.1.0 [ 12314542 ]
          Jeremy Bauer made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.0.0 [ 12314019 ]
          Fix Version/s 2.1.0 [ 12314542 ]
          Resolution Fixed [ 1 ]
          Jeremy Bauer made changes -
          Link This issue is required by OPENJPA-1091 [ OPENJPA-1091 ]
          Jeremy Bauer made changes -
          Field Original Value New Value
          Assignee Jeremy Bauer [ techhusky ]
          Leo Tu created issue -

            People

            • Assignee:
              Jeremy Bauer
              Reporter:
              Leo Tu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development