Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-11079

JPA: Hibernate extension mixed up OneToOne and OneToMany mappings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 3.3.0.Beta1
    • 3.3.0.M5
    • hibernate
    • None

    Description

      When work with OneToOne or OneToMany mappings there are several problems could occur. One of the is described here:
      https://community.jboss.org/message/720006

      Another I faced myself when tried to repruduce the mapping above:
      Caused by: java.lang.IllegalArgumentException: invalid mapping key: oneToOne
      at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaPersistentAttribute.getSpecifiedMappingDefinition(AbstractJavaPersistentAttribute.java:325)
      at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaPersistentAttribute.setMappingKey_(AbstractJavaPersistentAttribute.java:216)
      at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaPersistentAttribute.setMappingKey(AbstractJavaPersistentAttribute.java:195)
      at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaPersistentAttribute.setMappingKey(AbstractJavaPersistentAttribute.java:1)
      at org.eclipse.jpt.jpa.ui.internal.details.PersistentAttributeMapAsComposite$1.morphMapping(PersistentAttributeMapAsComposite.java:82)
      at org.eclipse.jpt.jpa.ui.internal.details.MapAsComposite.morphMapping(MapAsComposite.java:340)
      at org.eclipse.jpt.jpa.ui.internal.details.MapAsComposite$3.execute(MapAsComposite.java:206)
      at org.eclipse.jpt.jpa.ui.internal.details.MapAsComposite$3.execute(MapAsComposite.java:1)
      at org.eclipse.jpt.common.ui.internal.util.SWTUtil$1.run(SWTUtil.java:138)
      at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
      at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
      ... 23 more

      To reproduce:
      1. Create classes/mappings from issue above
      2. Set cursor to PasswordResourceAuditLogEntry#attributes
      3. Open JPA Details view
      FAILURE: "default(basic)" mapping is used
      4. Click on the "default(basic)" link
      5. Select "OneToOne" from the list
      FAILURE: Exception

      The reason is internal hibernate mixed up ManyToOne and OneToOne annotation definitions.

      Attachments

        Activity

          People

            dgeraskov Dmitry Geraskov (Inactive)
            dgeraskov Dmitry Geraskov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: