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

Lincoln Baxter III (Commented) (JIRA) jira-events at lists.jboss.org
Wed Dec 14 15:53:09 EST 2011


    [ https://issues.jboss.org/browse/FORGE-401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651049#comment-12651049 ] 

Lincoln Baxter III commented on FORGE-401:
------------------------------------------

I agree with removing the automatic initialization of the @ManyToOne - but you're right, I don't agree with adding it to @OneToOne :)
                
> 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;
> 	@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.

--
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