Hibernate version: 3.1final + annotations 3.1beta7
If I do the following:
Code:
@ManyToOne (fetch = FetchType.LAZY)
public Server getServer ()
{
return server;
}
then I get a column called server_id, as documented in the description of the defaults for @JoinColumn.
However, if I try to minimally modify tihs to set the nullability of the column, like this:
Code:
@ManyToOne (fetch = FetchType.LAZY)
@JoinColumn (nullable = false)
public Server getServer ()
{
return server;
}
then the column is called server_ (missing the "id"). Setting the name explicitly in @JoinColumn is the obvious work around, but I dislike re-specifying what should be the default.
Is it a bug, or a feature? I don't know if it makes a difference, but the id of the referenced entity, Server, is specified in an @EmbeddableSuperClass.
Chris.