For this particular issue, the custom Dialect is the best way to go. My idea was more of a new approach to Hibernate types. For backward compatibility, everything should stay as is. I was thinking of having a new configuration property hibernate.heuristic_discover_sql_type that is true by default, giving us the current heuristic SQL type assignment mechanism. When being false, we could inspect the actual schema and use the database column types. So, we would simply give the user the opportunity of choosing the right approach for his current application. |