|
Stephen Fikes, following up the query issue with HHH-9023. However, as described, this is currently working as expected, so HHH-9023 is a new-feature/RFE (and frankly is low priority).
As discussed, the merge/saveOrUpdate questions are now moot due to
HHH-7072
. From the discussion there:
For now, if the collection element is a component that consists entirely of nullable properties, we will have to forcefully recreate the entire collection. In order to only delete row-by-row as needed, that would require SQL like "WHERE ( COL = ? OR ( COL is null AND ? is null ) )", rather than the current "WHERE COL = ?" (fails for null for most DBs). Note that the params would have to be bound twice. Until we eventually add "parameter bind points" concepts to the AST in ORM 5+, handling this type of condition is either extremely difficult or impossible. Forcing recreation isn't ideal, but not really any other option in ORM 4.
So, if the @Embeddable has all nullable props, we have to completely delete all the entries, then re-insert them. The concept is the same for merge/saveOrUpdate since the query to find pre-existing entries would hit the same parameter binding issues.
|