[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6725) Bidirectional @OneToOne(optional=true) with a foreign ID generator should force optional=false
Gail Badner (JIRA)
noreply at atlassian.com
Mon Jan 9 02:23:10 EST 2012
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45011#comment-45011 ]
Gail Badner commented on HHH-6725:
----------------------------------
Specifically, we need a way to check for a "foreign" ID generator with @OneToOne(optional=true). In this case we want to log a warning and force optional=false.
It could be done while the persisters are being built, but I think it would be better if this happens when the metadata is being built.
> Bidirectional @OneToOne(optional=true) with a foreign ID generator should force optional=false
> ----------------------------------------------------------------------------------------------
>
> Key: HHH-6725
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6725
> Project: Hibernate Core
> Issue Type: Improvement
> Reporter: Gail Badner
> Assignee: Gail Badner
> Fix For: 4.1.0
>
>
> When a foreign ID generator is used with @OneToOne(optional=true), Hibernate should:
> - force optional=false
> - log a warning
> The default for @OneToOne is optional=true
> This should be done when a foreign ID generator is used
> - with @OneToOne @PrimaryKeyJoinColumn
> - with @OneToOne(mappedBy="...")
> Currently, Hibernate allows the one-to-one association to be optional, but if the association is set to null, IdentifierGenerationException is thrown.
> I don't think it's possible to check for a ForeignGenerator until the SessionFactory or persister is being built with a Configuration object.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list