Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-431

Order INSERT statements on joined subclasses from parent to child

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.0.0
    • None
    • sql
    • None

    Description

      When creating a joined subclass relationship, it is desirable on the database side to place an integrity constraint on the subclass table that its object_id must exist in the parent class's table. (Because the subclass's row cannot exist without the parent class's row.)

      Unfortunately, OpenJPA orders the inserts in the opposite direction, trying to insert the child entity first (probably because that's the entity that the code is actually persisting), so with the integrity constraint in place, the insert will fail.

      It would be nice if in a joined-subclass relationship where multiple inserts were needed, SQL would be issued in order of highest in the class hierarchy to lowest so that integrity constraints on the database won't be violated.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              spatula Nick Johnson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: