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

Richard Zowalla resolved OPENJPA-2434.
--------------------------------------
    Resolution: Fixed

Already fixed on master: OracleDictionary.getImportedKeys:1179 binds 
convertSchemaCase(tableName.getUnqualifiedName()), which is the exact change 
the issue proposes (87964e00c, ancestor of HEAD). Closing; please reopen if 
this still happens with OpenJPA 4.x.

> Open JPA not resolving foreign keys when generating beans by connecting to 
> Oacle DB
> -----------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2434
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2434
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.2.0
>            Reporter: Anand Kumar
>            Priority: Major
>
> I am trying to generate beans by connecting to Oracle DB. In the logs i see 
> that its trying to resolve Primary keys, Indexes and foreign keys. However, 
> does not find any foreign keys for the tables having FKs.
> I checked the code and found below:
> File: org.apache.openjpa.jdbc.sql.OracleDictionary.java
> Method:  public ForeignKey[] getImportedKeys(DatabaseMetaData meta, 
> DBIdentifier catalog,
>         DBIdentifier schemaName, DBIdentifier tableName, Connection conn, 
> boolean partialKeys)
> Line#951
> setString(stmnt, idx++, convertSchemaCase(tableName), null);
> I think we should use unqualified tableName, since the query to fetch the FKs 
> returns no result for qualified table names.
> setString(stmnt, idx++, convertSchemaCase(tableName.getUnqualifiedName()), 
> null);



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to