From 058f31a7692f410d7637a468c7b7882bd0c61a52 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Mon, 6 Mar 2023 09:37:56 +0100 Subject: [PATCH] Fix date truncation for HANA --- .../org/hibernate/dialect/function/CommonFunctionFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/CommonFunctionFactory.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/CommonFunctionFactory.java index a9815814c8..605b978c5f 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/CommonFunctionFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/CommonFunctionFactory.java @@ -314,7 +314,7 @@ public class CommonFunctionFactory { * SAP HANA */ public void trunc_roundMode() { - trunc( "round(?1,0,round_down)", "round(?1,?2,round_down)", TruncFunction.DatetimeTrunc.FORMAT, "to_date" ); + trunc( "round(?1,0,round_down)", "round(?1,?2,round_down)", TruncFunction.DatetimeTrunc.FORMAT, "to_timestamp" ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~