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

ReverseMappingTool omits nullable, length, etc. when ClassMapping.setEmbedded(true) is called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.2
    • 1.3.0, 2.0.0-beta3
    • tooling
    • None

    Description

      In my ReverseCustomizer, I call classMapping.setEmbedded(true). This is because for a variety of reasons I need the code that is generated by the ReverseMappingTool to be @MappedSuperclasses, not @Entities.

      Indeed when I do this, the resulting class is a @MappedSuperclass (great!) BUT all of the length and nullable and other @Column attributes are missing. In other words, all simple fields receive only a @Basic annotation, with no attributes, and nothing else. In addition, the class declaration receives a @Table annotation with no attributes. (I'm using the command line flag that instructs the ReverseMappingTool to generate annotations.)

      Ideally I'd like the generated source code to look identical to the source code that would be generated for a ClassMapping where setEmbedded(true) was never called, except of course that I want the @Entity annotation to be replaced with @MappedSuperclass.

      Obviously if there is a better way from within a ReverseCustomizer for me to accomplish my (very odd) goals (mandated by a strange development process and a 30-year-old database), I am all ears.

      Attachments

        1. OPENJPA-1360-trunk.patch
          1 kB
          Donald Woods

        Issue Links

          Activity

            People

              drwoods Donald Woods
              ljnelson Laird Nelson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: