[hibernate-issues] [JIRA] (HHH-13922) When an audited column uses a columnDefinition, schema validation may fail.

Chris Cranford (JIRA) jira at hibernate.atlassian.net
Wed Apr 1 16:32:48 EDT 2020


Chris Cranford ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aea49f1db-ef91-4d96-8f3a-a939be8d2b1c ) *commented* on HHH-13922 ( https://hibernate.atlassian.net/browse/HHH-13922?atlOrigin=eyJpIjoiMTk0MmRmY2Y0NTQxNDI1YThkMDMyNGVmZGY0MmNlZTgiLCJwIjoiaiJ9 )

Re: When an audited column uses a columnDefinition, schema validation may fail. ( https://hibernate.atlassian.net/browse/HHH-13922?atlOrigin=eyJpIjoiMTk0MmRmY2Y0NTQxNDI1YThkMDMyNGVmZGY0MmNlZTgiLCJwIjoiaiJ9 )

After investigation, I'm inclined to think the best course of action here might be to revert HHH-10844 ( https://hibernate.atlassian.net/browse/HHH-10844 ) Closed.

The changes introduced by HHH-10844 ( https://hibernate.atlassian.net/browse/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);
}

( https://hibernate.atlassian.net/browse/HHH-13922#add-comment?atlOrigin=eyJpIjoiMTk0MmRmY2Y0NTQxNDI1YThkMDMyNGVmZGY0MmNlZTgiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13922#add-comment?atlOrigin=eyJpIjoiMTk0MmRmY2Y0NTQxNDI1YThkMDMyNGVmZGY0MmNlZTgiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100123- sha1:26275c0 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200401/cd1199e0/attachment.html 


More information about the hibernate-issues mailing list