Nils Israel ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%... ) *commented* on HHH-16360 ( https://hibernate.atlassian.net/browse/HHH-16360?atlOrigin=eyJpIjoiYTk1MD... )
Re: On Postgresql with hbm2ddl.auto=update, timestamp columns are updated even when correct ( https://hibernate.atlassian.net/browse/HHH-16360?atlOrigin=eyJpIjoiYTk1MD... )
I tried to add a custom SizeStrategy to PostgreSQLDialect and setting the Size.length according to precision. But that had to much side effects.
But what about this?
static boolean hasMatchingLength(Column column, ColumnInformation columnInformation, Metadata metadata, Dialect dialect) {
final int actualSize = columnInformation.getColumnSize();
final int actualDecimalDigits = columnInformation.getDecimalDigits();
if (actualSize == 0 && actualDecimalDigits == 0) {
return true ;
} else {
final Size size = column.getColumnSize(dialect, metadata);
final Long requiredLength = size.getLength();
final Integer requiredPrecision = size.getPrecision();
return requiredLength != null && requiredLength == actualSize
|| requiredPrecision != null && requiredPrecision == actualDecimalDigits
|| requiredPrecision != null && requiredPrecision == actualSize
// according to IEEE 754 standard: binary64 precision of 53 bit has up 17 significant decimal digits
|| (requiredPrecision != null && requiredPrecision == 53 && actualSize == 17)
// according to IEEE 754 standard: binary32 precision of 23 bit has up 9 significant decimal digits
|| (requiredPrecision != null && requiredPrecision == 23 && actualSize == 9)
|| requiredPrecision == null && requiredLength == null ;
}
}
( https://hibernate.atlassian.net/browse/HHH-16360#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16360#add-comment?atlOrigin=ey... )
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.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:2b972a1 )