| When is the SessionFactory to be closed? When we don't use CustomTypes everything works fine. No, I was not fully aware of that. I was more thinking in line with a query plan in the database. Thanks for the clarification. Now that is clear, I think the solution is to properly define equals and hashCode on CustomType, so it can participate in the equals and hashCode of NativeSQLQuerySpecification. |