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

JoinColumn annotation not allowed in conjunction with *ToMany annotation

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0-M1, 2.0.0-M2, 2.0.0-M3
    • 2.0.0-M3
    • jdbc
    • None

    Description

      I receive the following exception if I have an Entity with a One(Many)ToMany relationship with another Entity.

      <openjpa-2.0.0-SNAPSHOT-r422266:805588 fatal user error> org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "....Entity", but this mapping cannot have columns in this context.

      To recreate the failure, add a @JoinColumn annotation to one of the *ToMany relationships in org.apache.openjpa.persistence.jdbc.annotations.AnnoTest1.
      example:
      @MapKey(name = "basic")
      @OneToMany(mappedBy = "oneManyOwner")
      @JoinColumn(name = "asdf")
      protected Map<String, AnnoTest2> inverseOwnerMapKey = new HashMap();

      Then run:
      trunk\openjpa-parent\openjpa-persistence-jdbc>mvn test -Dtest=org.apache.openjpa.persistence.jdbc.annotations.TestOneToMany

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            faywang Fay Wang
            curtisr7 Richard G. Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment