You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Jeremy Bauer (JIRA)" <ji...@apache.org> on 2010/04/15 21:48:49 UTC

[jira] Resolved: (OPENJPA-1605) ReverseMappingTool (SchemaGenerator) bug

     [ https://issues.apache.org/jira/browse/OPENJPA-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Bauer resolved OPENJPA-1605.
-----------------------------------

    Fix Version/s: 2.0.0
                   2.1.0
       Resolution: Fixed

Fixed in 2.0.x branch and trunk.  Leo - Thanks for reporting this problem and for the test case.  This problem was breaking one of the reverse mapping example, so it can be verified by running that example.

> 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
>            Assignee: Jeremy Bauer
>             Fix For: 2.0.0, 2.1.0
>
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira