First, for future reference, there is a "code" tag within the editor here that lets you post *formatted* code snippets. Please use it.
The problem is that you define a map whose elements are of type "Unit", which is also a mapped entity. So this is *supposed* to be a one-to-many entity association. But that's not what you have defined. You use the <element/> nested tag within the <map/> which is instead used to define a collection of "simple types". So Hibernate is serializing your Unit instances into the DB.
What you want instead is:
Code:
<map name="units" ...>
<key column="prodid"/>
<index column="prodId" type="long"/>
<one-to-many column="unitId" class="proj.Unit"/>
</map>
Also, I'm a little lost as to why you'd want to load a map of units that belong to a given product, and key that map by product-id. The map keys will all be the same.