Uploaded image for project: 'JBoss WFK 2'
  1. JBoss WFK 2
  2. WFK2-850

The class BookPk in the Seam example ui-ejb is not valid as a composite primary key

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.7.0.ER2
    • Fix Version/s: 2.7.0.CR1
    • Component/s: Seam 2
    • Labels:
    • Target Release:
    • Release Notes Docs Status:
      Not Required

      Description

      The class BookPk is used with the annotation @EmbeddedId in the class Book, so it has to comply the constrains of a composite primary key. However, there are two things which are not complied:

      • has protected no-arg constructor which should be public
      • There isn't defined the hashCode() method

      From the JPA 2.0 spec:

      The following rules apply for composite primary keys:
      • The primary key class must be public and must have a public no-arg constructor.
      ...
      • The primary key class must define equals and hashCode methods. The semantics of value equality for these methods must be consistent with the database equality for the database types to which the key is mapped.
      ...

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                manaRH Marek Novotny
                Reporter:
                mjobanek Matous Jobanek
                Tester:
                Matous Jobanek
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: