This is mainly a hibernate bug as hibernate should take care of properly mapping this, but since it apparently can't we have to think about a possible solution.
Right now, we just do a COUNT(DISTINCT id) for the count query which fails with embedded ids. I have to think about whether a distinct is required at all and if not, we could still do a count(*). If it is required, I don't know yet how we could implement this as we would need a composite type that has equality defined on a per-component level. Maybe the XML-type is a workaround for DB2?
This is mainly a hibernate bug as hibernate should take care of properly mapping this, but since it apparently can't we have to think about a possible solution.
Right now, we just do a COUNT(DISTINCT id) for the count query which fails with embedded ids. I have to think about whether a distinct is required at all and if not, we could still do a count(*). If it is required, I don't know yet how we could implement this as we would need a composite type that has equality defined on a per-component level. Maybe the XML-type is a workaround for DB2?