In https://hibernate.atlassian.net/browse/HHH-15495 we made sure UUID is treated as comparable type, which works great, except on PostgreSQL for the min/max aggregate functions. The workaround/emulation is to cast to text and the result of the aggregate function to uuid again. It’s not very efficient to do the casting, but it’s the best we can do without requiring users to add functions to PostgreSQL. Let’s make sure though, that users could override this behavior in a custom dialect subclass. |