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

For entity fields missing @Transient annotations, let us know the classes they are in.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.4.0
    • Component/s: None
    • Labels:
      None

      Description

      Hi, I'm on the Apache Roller team and we apparently have a dozen or so missing @Transient annotations somewhere within our many, many persistence classes but OpenJPA just tells us the element missing the annotation, not the entity class where that element is located[1].

      For example, running mvn test from Roller's weblogger-business module:

      575 RollerPU WARN [main] openjpa.Runtime - Fields "categories" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient.
      575 RollerPU WARN [main] openjpa.Runtime - Fields "entryAttributes" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient.
      575 RollerPU WARN [main] openjpa.Runtime - Fields "tags" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient.
      740 RollerPU WARN [main] openjpa.Runtime - Fields "inputStream" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient.
      740 RollerPU WARN [main] openjpa.Runtime - Fields "directory" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient.
      740 RollerPU WARN [main] openjpa.Runtime - Fields "tags" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient.
      781 RollerPU WARN [main] openjpa.Runtime - Fields "parent" are not a default persistent type, and do not have any annotations indicating their persistence strategy. They will be treated as non-persistent. If you intended for these fields to be persistent, be sure to annotate them appropriately. Otherwise annotate them with @Transient.

      These fields are so generic they could be on any of a half-dozen entity classes. If you could alter the error message to include the entity class where the field missing @Transient is located, it would be much easier for code cleanup/debugging. Thanks!

      [1] http://mail-archives.apache.org/mod_mbox/openjpa-commits/201201.mbox/%3C20120103184609.3E6B32388AB9@eris.apache.org%3E

      1. OPENJPA-2389.patch
        3 kB
        Ben
      2. OPENJPA-2389.txt
        1 kB
        Dalia Abo Sheasha

        Activity

        Hide
        curtisr7 Rick Curtis added a comment -

        Committed revision 1569557 to trunk.

        Show
        curtisr7 Rick Curtis added a comment - Committed revision 1569557 to trunk.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1569557 from Rick Curtis in branch 'openjpa/trunk'
        [ https://svn.apache.org/r1569557 ]

        OPENJPA-2389: Update message to be more descriptive. Patch contributed by Ben and Dalia Abo Sheasha.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1569557 from Rick Curtis in branch 'openjpa/trunk' [ https://svn.apache.org/r1569557 ] OPENJPA-2389 : Update message to be more descriptive. Patch contributed by Ben and Dalia Abo Sheasha.
        Hide
        dalia Dalia Abo Sheasha added a comment -

        Since it's not favorable to change our trace messages (due to existing tools that may rely on old messages), I changed the patch to have the code return the entity class with the field name instead of changing the message itself. This accomplishes the same goal but keeps the message as it is.

        Show
        dalia Dalia Abo Sheasha added a comment - Since it's not favorable to change our trace messages (due to existing tools that may rely on old messages), I changed the patch to have the code return the entity class with the field name instead of changing the message itself. This accomplishes the same goal but keeps the message as it is.
        Hide
        wizman Ben added a comment -

        Improve message for entity fields missing @Transient annotations - OPENJPA-2389

        Show
        wizman Ben added a comment - Improve message for entity fields missing @Transient annotations - OPENJPA-2389

          People

          • Assignee:
            curtisr7 Rick Curtis
            Reporter:
            gmazza Glen Mazza
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development