<class name="Product">
<id name="id"/>
<map name="sellingPrice">
<key column="PRODUCT" not-null="true" foreign-key="FK_SP_PRODUCT"/>
<map-key type="string" column="model” not-null="true"/>
<element type="double" column="price” not-null="false"/>
</map>
</class>
Product product = new Product();
Product.getSellingPrice().put(“XL”,null);
Product.getSellingPrice().put(“L”, 34.90);
session.save(product)
Gives the following SQL:
insert into PRODUCT (id) values (null)
call identity()
insert into SELLINGPRICE (PRODUCT, MODEL, PRICE) values (?, ?, ?)
And the SELLINGPRICE table indeed only has one row. Why does Hibernately *silently* remove my null-valued entry?
I opened a JIRA issue for this at
http://opensource.atlassian.com/project ... e/HHH-4947