{{{
@ManyToOne(cascade=CascadeType.MERGE,fetch=FetchType.LAZY,optional=false)
@JoinColumn(name="FK_OrgId",nullable=true,updatable=false)
@NotNull
public Organization getOrganization()
{
[...]
}
}}
This annotation will create a NOT NULL constraint on the column when it shouldn't. The JoinColumn configuration should override the default generated by "optional=false".
This is relevant in single table inheritance situations. In this case a child class which has the getOrganization method cannot have a nullable=false setting, for obvious reasons.
This is problematic because in testcases where the database is generated on the fly, Hibernate will always fail because the unwanted constraint prevents any objects to be saved with organization = null;
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira