openjpa icon indicating copy to clipboard operation
openjpa copied to clipboard

Fix primary keys and foreign keys not being reversed on Oracle

Open drungrin opened this issue 5 years ago • 4 comments

Primary keys and foreign keys not being reversed when targeting a subset of the schemas on Oracle.

Using the HR demo database:

    var options = new Options();
    options.put("properties", "<location of persistence xml>");

    var configuration = new JDBCConfigurationImpl();
    Configurations.populateConfiguration(configuration, options);

    var generator = new SchemaGenerator(configuration);

    generator.generateSchemas(new DBIdentifier[]{
        DBIdentifier.newTable("HR.REGIONS"),
        DBIdentifier.newTable("HR.COUNTRIES"),
        DBIdentifier.newTable("HR.LOCATIONS"),
        DBIdentifier.newTable("HR.LOCATIONS"),
        DBIdentifier.newTable("HR.DEPARTMENTS"),
        DBIdentifier.newTable("HR.JOBS"),
        DBIdentifier.newTable("HR.EMPLOYEES"),
        DBIdentifier.newTable("HR.JOB_HISTORY"),
    });

drungrin avatar Jul 16 '19 14:07 drungrin

@drungrin sorry for late reply: the proposed changes look good to me. Meanwhile, could you please open an issue on JIRA?

@struberg can you take a look?

ilgrosso avatar Jul 22 '19 09:07 ilgrosso

I Opened an issue on JIRA.

https://issues.apache.org/jira/projects/OPENJPA/issues/OPENJPA-169

drungrin avatar Jul 23 '19 22:07 drungrin

@drungrin I guess you mean OPENJPA-2794, correct?

ilgrosso avatar Jul 24 '19 05:07 ilgrosso

Yes, n OPENJPA-2794 is the one I created, sorry for the mistake.

drungrin avatar Jul 24 '19 11:07 drungrin