Skip to content

Commit

Permalink
Change prepareStatement call when no generated keys are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanradic committed Jan 14, 2025
1 parent f874753 commit 14bc018
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,10 @@ private PreparedStatement prepare(Connection connection, SqlStoredQuery<T, ?> st
}
return connection.prepareStatement(this.storedQuery.getQuery(), new String[]{persistentEntity.getIdentity().getPersistedName()});
} else {
return connection.prepareStatement(this.storedQuery.getQuery(), hasGeneratedId ? Statement.RETURN_GENERATED_KEYS : Statement.NO_GENERATED_KEYS);
if (hasGeneratedId) {
return connection.prepareStatement(this.storedQuery.getQuery(), Statement.RETURN_GENERATED_KEYS);
}
return connection.prepareStatement(this.storedQuery.getQuery());
}
} else {
return connection.prepareStatement(this.storedQuery.getQuery());
Expand Down

0 comments on commit 14bc018

Please sign in to comment.