Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2
Hi,
We are migrating from Jboss 3.2.2.1 SP1 to Jboss 4.3.0.GA. As the part of migration we are migrating from hibernate 2.0 to hibernate 3.2. The query functionality is returning null, if the hibernate mapping file has one or more <key-property> elements who's value is null in the database as part of the composite key represented by <composite-id> element.
For example the below mapping file has a composite key defined as a combination of 4 properties. If one of the property value in the database is null then the query returns a Collection having a null result value. But if all the values are non null then the query returns valid collection with the correct pojo object results.
This same mapping file works perfectly with hibernate 2.0 in JBOSS 3.2.2.8SP1 even if one of the property of the composite key has a null value in the database. We are experiencing this problem as part of our migration efforts.
Could you please let us know what has changed between the versions of Hibernate and JBOSS that is resulting in such inconsistent behaviour.
<hibernate-mapping>
<class
name="com.abb.sable.mi.inf2.mpr.model.ErcotMfBusinessAssociates"
table="MF_BUSINESS_ASSOCIATES"
>
<composite-id>
<key-property
name="busAssocId"
type="java.lang.Long"
column="BUS_ASSOC_ID"
length="15"
/>
<key-property
name="effDate"
type="java.sql.Date"
column="EFF_DATE"
length="7"
/>
<key-property
name="expDate"
type="java.sql.Date"
column="EXP_DATE"
length="7"
/>
<key-property
name="shortName"
type="java.lang.String"
column="SHORT_NAME"
length="12"
/>
</composite-id>
</class>
</hibernate-mapping>