Association cardinalities ignored in Hibernate cartridge

Description

There are some problems with the not-null attribute in *.hbm.xml files.

1. If association is many-to-one, "inheritance" strategy in use, and cardinality is actually 0..1 on the one side, the many side declares the foreign key as not-null="true".

2. If association is many-to-one, no inheritance, and cardinality is actually 1 on the one side, the foreign key does not have a not-null="true" setting.

Other conditions workout OK, but I believe just due to the constant behavior. I suspect that cardinalities are never payed any attention, and that the following rules are in effect for association foreign keys:

1. If any inheritance is used, subclass or inheritance strategies, all associations become not-null="true".

2. If no class hierarchy exists, just a plain single class, all associations do not have any not-null attribute specified regardless of whether the model requires it or not.

Environment

Binary release, 3.0-RC1-SNAPSHOT, dated 30. Jan 2005

Status

Assignee

MichaelM

Reporter

David R. Allen

Labels

None

Fix versions

Priority

Major
Configure