After investigation, I'm inclined to think the best course of action here might be to revert HHH-10844 Closed . The changes introduced by HHH-10844 Closed was an attempt to resolve a column's Type back to a SQL Type. For cases where the mapping between Java and SQL types were 1:1, this seemed to work fine but in cases where the types ultimately differed in the case presented above, this resolved in a situation where the audit table's resolved type was incorrect. One idea that might work here would be to introduce a ColumnDefinitionResolver contract that would know how to reliably extract the appropriate bits from the columnDefinition that is dialect-specific. This contract could also be extended by the user allowing them full control over the resolution in situations where the default behavior was limiting or prohibitive.
public interface ColumnDefinitionResolver {
/**
* @param columnDefinition the column definition from the base table mapping
* @param dialect the dialect
*/
String resolveAuditColumnDefinition(String columnDefinition, Dialect dialect);
}
|