I don't think you can set your ID to null. Is ID a primary key that auto increments at your database? If it does, then you want to configure your Widget.hbm.xml file to say auto increment the next ID for me.
For example, Widget.hbm.xml could look something like this
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping >
<class name="x.y.z.Widget" table="Widget">
<id name="id" column="id" type="java.lang.Integer">
<generator class="increment"/>
</id>
...
</class>
</hibernate-mapping>
So, the <generator> tag will say to increment the ID column.
And I believe if you want to assign your own ID value, then you could probably try <generator class="assigned"/> instead.
Cheers