Example of Returning in a INSERT

I’m having a permissions problem at my workplace, related to auto-increments, I investigated and realized that Hibernate when doing an insert of the auto-increment type does a “Returning” to retrieve the auto-generated id, could you give me an example of how the query would look like? I didn’t find any examples, and I must give an example to request the permissions

It’s an IBM I database, I don’t know if there is an example of a native query or at least in JPQL, thanks in advance

I think you might be affected by HHH-18642. Please try to update to Hibernate ORM 6.6.4.Final and let us know if that fixes the problem for you.

As soon as they release the Spring 3.4.1 update to Maven I will try it.

You can update already if you want, just declare a dependency on the hibernate-core artifact with that particular version.

I have already tested the functionality on IBM I, and it still gives me an error, specifically this one:

[PWS9801] Function rejected by user exit program PTNS0107 in QGPL.]]

That’s unfortunate, but since we have no way of testing IBM for i, you will have to help us a bit here. Please start by creating an isolated reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.

Also, give as much detail about the error (e.g. stack trace) as possible on the Jira issue. If you have a clue how this can be solved, please also share that.