Hi Pramod,
A couple of comments.
1. Is it possible to add tests for these issues?
2. Our coding standard requires brackets around the contents of if
statements even if they are only one line. Could you please add
brackets to the if statement in
addForeignKeyFieldToSourceTargetTable(OneToOneMapping mapping)
3. In addJoinColumnsFkFieldToFieldDefinition(final Map srcFields), it
may be more efficient to iterate over the entry set, that way you won't
have to do a lookup for the dbTrgField. I am happy with leaving this
the way it is, but thought I would mention this suggestion.
-Tom
Pramod Gopinath wrote:
>Hi Tom
> Here are code changes relevant for issues 668 and 716.
>
>Issue 668: Java2DB generates FK for both sides of bi-directional
>relationship
>Issue 716: Java2DB does not generate the FK keys if PKjoinstrategy has
>been defined
>
>The code changes to resolve these issues are made to :
>entity-persistence/src/java/oracle/toplink/essentials/tools/schemaframework/DefaultTableGenerator.java
> - In case of Issue 668: if we have @OneToOne mapping defined on both
>the classes, then we were generating FK constraints for both the
>tables. Added logic to ensure that we define FK constraint on the owning
>side side.
>
> - Added 2 methods processAdditionalTablePkFields(..) &
>addJoinColumnsFkFieldToFieldDefinition(..).
> The primary key join strategy that might defined for a class can be
>obtained from the classdescriptor using the
>getAdditionalTablePrimaryKeyFields() method. Iterate over this list to
>generate the appropriate FK constraints.
>
>entity-persistence/src/java/oracle/toplink/essentials/tools/schemaframework/TableDefinition.java
> - Issue 668:Ensure that we use the fully qualified name of the table
>when generating the FK constrains.
>
>
>Thanks
>Pramod
>
>
>
--
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com