Hibernate version: 3.1.2
I'm trying to make an association that is optional, i.e. class A may reference an instance of B, but the reference may also be null.
The assocation is declared as:
Code:
<many-to-one name="exampleProject" class="Project" column="example_project" outer-join="true" not-null="false"/>
But this is causing a NullPointerException when fetching the object having this association.
Is there some way of declaring [many|one]-to-one-or-zero that I don't know about? The only other solution I can imagine is use a collection association as the collection can be empty, but that's not a very satisfactory solution.
[/code]