Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-39

Composite Key field in JoinColumn causes Repeated column in mapping

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • Preview 3
    • Preview 3
    • None
    • None

    Description

      When a field is part of a composite key (via @Dependent) is also referenced in a JoinColumn for a OneToMany or ManyToOne relationship Hiberate produces the following error:

      I Depend On:
      Depends On Me: org.hibernate.MappingException: Repeated column in mapping for c
      lass org.jboss.tutorial.composite.bean.Customer should be mapped with insert="false" update="false": flightId

      According to Hibernate discussions this problem can be fixed by marking the OneToMany as "update=false, insert=false" however this doesn't seem to be part of the 3.0 spec.

      For Example:

      http://forum.hibernate.org/viewtopic.php?t=927072&highlight=

      <many-to-one name="mtcepByCcidAndNcell"
      update="false"
      insert="false"
      class="se.ericsson.lmc.ccl.model.dto.temp_lmcfrob_hbm.hibernate.Mtcep">
      <column name="ccid"/>
      <column name="ncell"/>
      </many-to-one>

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            graysonpierce Grayson Pierce (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: