I mapped following map collection:
<map name="customFields" table="table_name" fetch="select">
<key column="primary_id" />
<map-key-many-to-many column="custom_id" class="CustomField" />
<many-to-many column="other_id" class="AnotherClass" />
</map>
This works great; all records are added to the map if columns 'primary_id', 'custom_id' and 'other_id' are all filled with a value.
But when 'other_id' column is empty, that record is not added to the map. Is there a property or something I can force Hibernate to add these records to the Java Map as well?
Visualisation
+------------+-----------+----------+
| primary_id | custom_id | other_id | Added?
+------------+-----------+----------+
| 1 | 53 | 124 | YES
| 2 | 98 | 288 | YES
| 3 | 18 | NULL | NO
+------------+-----------+----------+