[forge-issues] [JBoss JIRA] (FORGE-401) PersistencePlugin should not initialize default value for @ManyToOne

Richard Kennard (Created) (JIRA) jira-events at lists.jboss.org
Tue Dec 6 18:14:40 EST 2011


PersistencePlugin should not initialize default value for @ManyToOne
--------------------------------------------------------------------

                 Key: FORGE-401
                 URL: https://issues.jboss.org/browse/FORGE-401
             Project: Forge
          Issue Type: Bug
            Reporter: Richard Kennard


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 = new Employer();

	@ManyToOne
	private Employer employer = new Employer();

The first one is non-controversial. The second is slightly controversial but actually makes things much easier for the UI so please keep it :)

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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the forge-issues mailing list