OpenJPA
  1. OpenJPA
  2. OPENJPA-435

Change mapping defaults to assume foreign keys exist for relationships by default

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0, 0.9.6, 0.9.7, 1.0.0, 1.0.1, 1.0.2, 1.1.0
    • Fix Version/s: 1.3.0
    • Component/s: sql
    • Labels:
      None

      Description

      OpenJPA's current defaults assume that no foreign keys exist. This leads to potentially more optimal SQL ordering, but often also leads to FK constraint violations when obvious FKs exist but are not declared. We should change this default to be more user-friendly, and add a note to our optimization guide as appropriate if there are actions users should take to optimize.

        Issue Links

          Activity

          Michael Dick made changes -
          Fix Version/s 1.3.0 [ 12313326 ]
          Fix Version/s 1.2.0 [ 12313102 ]
          Patrick Linskey made changes -
          Fix Version/s 1.2.0 [ 12313102 ]
          Fix Version/s 1.1.0 [ 12312344 ]
          Patrick Linskey made changes -
          Comment [ I believe that this can be worked around in the short term by setting the MappingDefaults ForeignKeyDeleteAction and JoinForeignKeyDeleteAction properties to 'restrict':

          <property name="openjpa.MappingDefaults"
              value="ForeignKeyDeleteAction=restrict, JoinForeignKeyDeleteAction=restrict"/>

          Could someone who is seeing this behavior in their app give this a try and comment on this issue, please? ]
          Patrick Linskey made changes -
          Field Original Value New Value
          Link This issue is related to OPENJPA-431 [ OPENJPA-431 ]
          Patrick Linskey created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Patrick Linskey
            • Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development