glassfish
  1. glassfish
  2. GLASSFISH-20895

@ForeignKey creates wrong ALTER TABLE statement

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Oracle Database

      Description

      according to JSR-338 all fields within @ForeignKey are optional.
      However, if only name is provided the following (wrong) statement is created:
      ALTER TABLE JEE7jpacar ADD CONSTRAINT FKc2o FOREIGN KEY () REFERENCES ()

      @Entity
      @Table(name="JEE7jpacar")
      public class Car {

      @Id
      private String plate;

      @ManyToOne
      @JoinColumn(name="O_LAST",foreignKey=@ForeignKey(name="FKc2o"))
      private Owner owner;
      ...
      }

      @Entity
      @Table(name="JEE7jpaowner")
      public class Owner {
      @Id
      @Column(name="LAST")
      private String lastname;
      ...
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Mitesh Meswani
            Reporter:
            ChristianSch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: