optional=false add an unexpected unique constraint

Description

I have a very simple OneToOne relationship:

@OneToOne(optional = false,orphanRemoval = false)
@JoinColumn (name="leadform_id",unique=false)
public Leadform getLeadform() {
return leadform;
}

When using optional = false
I get in my hbm2ddl schema: unique (leadform_id)

When using optional = true, i don't have that unique constraint.

Documentation says:
"If set to false then a non-null relationship must always exist."
And in my case it does, but the documentation doesn't say this optional attribute has any effect on the unique constraint.

Actually i think everybody expect that constraint to be handled by the JoinColumn unique=false attribute, or at least to find the information in the documentation.

It affects hbm2ddl when using the maven hibernate3:hbm2ddl goal but also when hibernate creates the test tables in H2

Environment

Oracle 10g, Hibernate 3.6.4, Hbm2ddl, H2...

Assignee

Brett Meyer

Reporter

SĂ©bastienL

Fix versions

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure