Skip to content

Commit cd49b1f

Browse files
committed
Support IDENTITY for Integer with MySQL
1 parent be63ffe commit cd49b1f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/impl/SqlClientConnection.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ private static <T> T getLastInsertedId(RowSet<Row> rows, Class<T> idClass, Strin
324324
if ( Long.class.equals( idClass ) ) {
325325
return (T) mySqlId;
326326
}
327+
if ( Integer.class.equals( idClass ) ) {
328+
return (T) ( Integer.valueOf( mySqlId.intValue() ) );
329+
}
327330
throw LOG.nativelyGeneratedValueMustBeLong();
328331
}
329332
final Row oracleKeys = rows.property( ORACLE_GENERATED_KEYS );

0 commit comments

Comments
 (0)