-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exclusion of null-valued map entry
PostPosted: Tue Feb 23, 2010 4:44 pm 
Beginner
Beginner

Joined: Tue Aug 25, 2009 11:42 am
Posts: 49
<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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.