From b41d812659a043c6905f2a896caa5ba7454c0a41 Mon Sep 17 00:00:00 2001 From: Falko Modler Date: Sun, 17 May 2020 18:21:08 +0200 Subject: [PATCH] HHH-14023 H2Dialect: adjust NUMERIC, DECIMAL & VARBINARY for 1.4.201+ --- .../src/main/java/org/hibernate/dialect/H2Dialect.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java index 265466222b..d76dd22579 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java @@ -118,8 +118,8 @@ public class H2Dialect extends Dialect { registerColumnType( Types.BIT, "boolean" ); registerColumnType( Types.CHAR, "char($l)" ); registerColumnType( Types.DATE, "date" ); - registerColumnType( Types.DECIMAL, "decimal($p,$s)" ); - registerColumnType( Types.NUMERIC, "decimal($p,$s)" ); + registerColumnType( Types.DECIMAL, buildId >= 201 ? "numeric($p,$s)" : "decimal($p,$s)" ); + registerColumnType( Types.NUMERIC, buildId >= 201 ? "numeric($p,$s)" : "decimal($p,$s)" ); registerColumnType( Types.DOUBLE, "double" ); registerColumnType( Types.FLOAT, "float" ); registerColumnType( Types.INTEGER, "integer" ); @@ -132,7 +132,7 @@ public class H2Dialect extends Dialect { registerColumnType( Types.TIME, "time" ); registerColumnType( Types.TIMESTAMP, "timestamp" ); registerColumnType( Types.VARCHAR, "varchar($l)" ); - registerColumnType( Types.VARBINARY, "binary($l)" ); + registerColumnType( Types.VARBINARY, buildId >= 201 ? "varbinary($l)" : "binary($l)" ); registerColumnType( Types.BLOB, "blob" ); registerColumnType( Types.CLOB, "clob" );