Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-397

PersistencePlugin does not mark one side of a OneToOne as 'mappedBy'

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.Beta4
    • None
    • None
    • None

      The PersistencePlugin currently generates OneToOne relationships like this:

      @OneToOne
      private Profile profile;

      public Profile getProfile()

      { return this.profile; }

      public void setProfile(final Profile profile)

      { this.profile = profile; }

      ...and...

      @OneToOne
      private Customer customer;

      public Customer getCustomer()

      { return this.customer; }

      public void setCustomer(final Customer customer) { this.customer = customer; }

      Ideally one side of the relationship should be marked as the 'inverse':

      @OneToOne(mappedBy="profile")
      private Customer customer;

      public Customer getCustomer() { return this.customer; }

      public void setCustomer(final Customer customer)

      { this.customer = customer; }

              lincolnthree Lincoln Baxter III (Inactive)
              kennardconsulting Richard Kennard (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: