This is my Class.hbm.xml:
generated with middlegen and hbm2java (unfortunately this table has not a PrimaryKey).
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>
<!--
Created by the Middlegen Hibernate plugin 2.2
http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->
<class
name="Class"
table="CLASS"
lazy="false"
>
<composite-id>
<key-property
name="Id"
column="ID"
type="java.lang.Integer"
length="10"
/>
<key-property
name="description"
column="DESCRIPTION"
type="java.lang.String"
length="10"
/>
</composite-id>
<!-- Associations -->
<!-- derived association(s) for compound key -->
<!-- end of derived association(s) -->
</class>
</hibernate-mapping>
This is my DB:Code:
ID | DESCRIPTION
________________________________
1 | Test
2 | NULL
when in my business-class, using Hibernate Criteria, I try to retrieve the DB ROW
the first one is correctly instantiated to a Class Object
the second one is NULL
why ?
how can I allow NULL value in DESCRIPTION column ?