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

PersistencePlugin should not initialize default value for @ManyToOne

XMLWordPrintable

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

      At present the PersistencePlugin generates the following default values in its entity beans:

      @OneToMany
      private Set<Grocery> groceries = new HashSet<Grocery>();

      @OneToOne
      private Employer employer;

      @ManyToOne
      private Employer employer = new Employer();

      The first one is non-controversial. The second one I would like to be initialized (please please?) as it makes things much easier for the UI. But I understand if you are against that.

      But the final one I definitely think should be removed. We should just leave @ManyToOne relationships as 'null' by default. It doesn't make sense to pre-initialize them, even for new entities, because they are meant to point to existing entities.

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

                Created:
                Updated:
                Resolved: