Hello. I use Hibernate 3.2.1ga and found a problem while mapping entity for legacy database. Entity has a composite primary key with 6 columns:
- project name
- project version
- activity name
-resource name
which are not-null and
- start date
- finish date
any of which/or both are nullable.
When Hibernate fetches from database entities which have one-to-many relation to this one, the target collection is empty but as I can see SQL performed by Hibernate gives me in sqlplus 1 record whith "start date" (for example) = null. If I change both columns values in database to be not null, Hibernate gives me a collection of 1 element. It seems that Hibernate does not create a Java object and event its Id object if any of primary key columns is null.
Does Hibernate provide an ability to work with tables which have composite IDs with nullable column? How to resolve the problem?
Thanks in advance
|