IdClass is not working with Hibernate 6.5.2.Final

We are using @IdClass for composite key and save() to save the data.But after upgrading
to Java 21 and Springboot3.3.3 and latest hibernate
jars to 6.x, save() is not working.
Issue is like before calling save(), internally a query is triggered to check the data
in db for the composite key is existing or not for which internally generated query is
wrong as mentioned below -

CAUSED BY: Exception: Syntax error
), Query:

SELECT   
   um1_0.id,
   um1_0.user_name,
   um1_0.valid_from,
   um1_0.active_inactive_status,
   um1_0.created_updated_date,
   um1_0.email_id,
   um1_0.user_company,
   um1_0.user_creation_date,
   um1_0.user_group,
   um1_0.user_modification_date,
   um1_0.user_status,
   um1_0.valid_to
 FROM   user_master um1_0
 WHERE  ( um1_0.id, um1_0.user_name, um1_0.valid_from ) IN (
   ( 1, '103', '2023_Q4' )) .

 2024-09-03T11:32:28.292Z ERROR 1 --- [] [io-8084-exec-10] 
 c.c.a.p.s.i.m.UserMasterServiceImpl      : Unable to add new user 
 masterorg.springframework.orm.jpa.JpaSystemException: JDBC exception executing SQL m 
 [select  
   um1_0.id,
   um1_0.user_name, 
   um1_0.valid_from,
   um1_0.active_inactive_status,
   um1_0.created_updated_date,
   um1_0.email_id,
   um1_0.user_company,
   um1_0.user_creation_date,
   um1_0.user_group,
   um1_0.user_modification_date,
   um1_0.user_status,
   um1_0.valid_to
   from user_master um1_0 where (um1_0.id,um1_0.user_name,um1_0.valid_from) in 
	((?,?,?))] [[Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. 
   Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, 
   errorMessage:ParseException: Syntax error in line 1:
   ...ster um1_0 where (um1_0.id,um1_0.user_name,um1_0.valid...


   Encountered: COMMA
   Expected: AND, BETWEEN, DIV, ILIKE, IN, IREGEXP, IS, LIKE, NOT, OR, REGEXP, RLIKE 

Here is the Entity class -

   import lombok.AllArgsConstructor;
   import lombok.Data;
   import lombok.NoArgsConstructor;

   import jakarta.persistence.*;
   import java.io.Serializable;
   import java.time.LocalDateTime;

   @Data
   @AllArgsConstructor
   @NoArgsConstructor
   @Entity
   @Table(name = "user_master")
   @IdClass(UserMasterSequenceId.class)

public class UserMaster implements Serializable {

@Id
@Column(name = "id")
private int id;

@Column(name = "user_name", nullable = false)
private String  userName;

@Column(name = "email_id", nullable = false)
private String emailId;

@Column(name = "user_company", nullable = false)
private String userCompany;

@Column(name = "user_group", nullable = false)
private String userGroup;

@Column(name = "user_creation_date", nullable = false)
private String userCreationDate;

@Column(name = "user_modification_date", nullable = false)
private String userModificationDate;

@Column(name = "user_status", nullable = false)
private String userStatus;

@Column(name = "valid_from", nullable = false)
private String validFrom;

@Column(name = "valid_to", nullable = false)
private String validTo;

@Column(name = "active_inactive_status", nullable = false)
private String activeInactiveStatus;

@Column(name = "created_updated_date")
private LocalDateTime createdUpdatedDate;

}

and IdClass is -

import java.io.Serializable;
public class UserMasterSequenceId implements Serializable {

private int id;
private String userName;
private String validFrom;

}

Please help. Thanks in advance.

Please share the full stack trace of the exception. There are many things at play here, it would be great if you could reproduce the problem without Spring and using only Hibernate, our test case template are a good place to start from.

From my knowledge, Spring repositories use a merge when calling save, instead of persist. This does not make much sense, but it should still work correctly - so that might be the starting point for reproducing the error. If you manage to create a reproducer, please open new ticket in our issue tracker and attach that reproducer.