From 839bf0b6f9b1e82564d63fa84f0ca1d6257613fb Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Wed, 31 Aug 2016 00:22:16 -0700 Subject: [PATCH] HHH-11073 : Casting to boolean in HQL query fails on MySQL --- .../src/main/java/org/hibernate/dialect/MySQLDialect.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java index 773f8c158d..43c0bee1d4 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java @@ -341,6 +341,8 @@ public class MySQLDialect extends Dialect { @Override public String getCastTypeName(int code) { switch ( code ) { + case Types.BOOLEAN: + return "char"; case Types.INTEGER: case Types.BIGINT: case Types.SMALLINT: