[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-772?page=co...
]
Michael Newcomb commented on HHH-772:
-------------------------------------
Just spent an hour trying to figure out what I was doing wrong... come to find out I
wasn't doing anything wrong...
As to not obeying the Map api, on a new entity, the map you populate is your map until you
persist the entity, so they can't really do anything at that point. Now when you load
an entity PersistentMap could throw NullPointerException if someone tried to put a null
value in. So, they can stop it on a Hibernate loaded entity, but not from one you just
persisted. From that perspective it is inconsistent but they can't really do anything
about it.
IMHO, since they can't do anything about it, they should *persist* everything they can
in a map because the only alternative is inconsistency. I give you a map with some null
values and Hibernate silently drops them on the floor. However, they are still in the map
of the entity until a new one is loaded. That is by definition inconsistent.
Another alternative would be for Hibernate to throw an exception when a Map is persisted
with null values. I could live with that.
On a positive note, Hibernate KICKS ASS and these issues are relatively minor.
On a negative note, there is an attitude of superiority that emanates from the direction
of the Hibernate team that is not helpful and I think it causes some bugs to be dropped on
the floor. HHH-3223 : Map.remove() is broken, yet a patch has existed for almost 2 years!
null in maps are handled inconsistently
---------------------------------------
Key: HHH-772
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-772
Project: Hibernate Core
Issue Type: Improvement
Components: core
Reporter: Max Rydahl Andersen
Fix For: 3.1 beta 1
regarding case 00004729.
group.getUsers().put("something", null);
Does not result in any insert.
Inserting "something", null manually into the underlying table and
when hibernate reads the map will have "something"->null in the map.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira