[
https://hibernate.onjira.com/browse/HHH-1109?page=com.atlassian.jira.plug...
]
Piotr Jagielski commented on HHH-1109:
--------------------------------------
I have exactly the same situation as in description - a db-view, which combines two tables
by outer-join. In my case the only unique combination of columns contains a nullable
column. I don't need primary key but Hibernate forces me to define one. Since this
request is rejected then what is the correct way to handle such situation in Hibernate?
composite-key does not support null-values
------------------------------------------
Key: HHH-1109
URL:
https://hibernate.onjira.com/browse/HHH-1109
Project: Hibernate ORM
Issue Type: Bug
Affects Versions: 3.0.5
Environment: [org.hibernate.type.EmbeddedComponentType.hydrate(...)#425]
Reporter: Holger Bartnick
Attachments: componentType-fix-nullkey-compositekey.patch,
NullableStringType.java
Original Estimate: 8h
Remaining Estimate: 8h
At present all legacy data with null-values in its composite-key could not be read
properly by hibernate.
While hibernate processes the resultset it returns null for that record and steps over to
the next one.
Think of a db-view, which combines two (or more) tables by outer-join.
(that seems only necessary for crude legacy data indeed... but it´s not that unusual as
you think)
The workaround is to use a db-generated identifier for each view-record (ex. combining
the nullable-id fields).
It would be fine, if hibernate is not reliant on that. ;-)
To allow having composite-keys with partly null-Values, you could think of moving the
"unsaved-value"-attribute
of the "composite-key"-tag to
"key-property|key-many-to-one"-Tags...?!
---
Mmmh... saw you´ve done something with "columnNullness" in ver 3.1beta2.
Perhaps it is fixed in there...
also seen on HB-613
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira