openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Tu (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1605) ReverseMappingTool (SchemaGenerator) bug
Date Wed, 31 Mar 2010 15:53:27 GMT
ReverseMappingTool (SchemaGenerator) bug
----------------------------------------

                 Key: OPENJPA-1605
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1605
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.0.0-beta3
            Reporter: Leo Tu


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.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message