diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/StatementPreparerImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/StatementPreparerImpl.java index b19193b02e..7f6a67c400 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/StatementPreparerImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/StatementPreparerImpl.java @@ -121,7 +121,7 @@ class StatementPreparerImpl implements StatementPreparer { jdbcCoordinator.executeBatch(); return new StatementPreparationTemplate( sql ) { public PreparedStatement doPrepare() throws SQLException { - return connection().prepareStatement( sql, new int[]{ 1 } ); + return connection().prepareStatement( sql, autoGeneratedKeys ); } }.prepareStatement(); }