Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-4022

TypeMismatchException on object equality expression from one-to-one relationship [HHH-2088]

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: EAP 5.0.0, EAP 5.0.1
    • Fix Version/s: EAP_EWP 5.1.0
    • Component/s: Hibernate
    • Labels:
      None
    • Affects:
      Release Notes
    • Workaround Description:
      Hide

      This can be work around by change the mapping to ManyToOne.

      Show
      This can be work around by change the mapping to ManyToOne.

      Description

      [is related to http://opensource.atlassian.com/projects/hibernate/browse/HHH-2088]

      Suppose to have entity A with a one-to-one constrained relationship to an entity B, called bRel.
      The query: "from A a, B b where a.bRel = b" raises a TypeMismatchException, even if bRel and b are instances of the same entity.
      This happens because in BinaryLogicOperatorNode:

      • lhsType is org.hibernate.type.Type = org.hibernate.type.OneToOneType(B)", with getColumnSpan returning 0.
      • rhsType is org.hibernate.type.Type = org.hibernate.type.ManyToOneType(B)", with getColumnSpan returning 1.
        And it compares the two columnspans.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                stliu Strong Liu
                Reporter:
                sjmenden Samuel Mendenhall
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: