| Well you can work around the problem by introducing whatever function you like but I don't think Hibernate should use a checksum as a "fallback" at least not by default. It can lead to wrong results depending on the collision probability so it's not entirely safe. The general suggestion from the community is to create a computed column and count distinct on that. You can use a checksum, concat or whatever you think is best. If your composite id is numeric only, then concat is probably a good fit because you can just introduce a non-numeric character for concatenation and you get a unique value. If you have strings, then you might want to think about a character that isn't contained in the strings for concatenation or you go the checksum route. Either way, I don't think Hibernate can do anything helpful in this case. |