When generating a property with
type="float", the hbm2java tool is generating code with the native "float" type, and not "Float" as it should. Since the column is nullable, this (expectedly) throws an exception when Hibernate tries to write the null value to the object. I tried to specifically use "Float" in the definition file, but Hibernate did not recognize that type. Note that the other field (type="integer") does correctly generate a Java "Integer" object (therefore allowing null).
Suggestions?
Hibernate version: 3.2.0.200801290813-nightly (also tested with 3.2.0 GA)
Mapping documents:
Code:
...
<class name="MyTable" table="MY_TABLE" mutable="false">
<id name="id" column="id" type="integer"/>
<property name="age" column="age" type="integer" not-null="false"/>
<property name="weight" column="weight" type="float" not-null="false"/>
</class>
...
Generated code:Code:
...
private Integer id;
private Integer age;
private float weight;
...
Database: Oracle 10g