I have a stored procedure that returns different resultsets each consisting of different columns. I use an implementation object of ProcedureOutputs to retrieve each resultset consequtively using the method callOutputs.getCurrent() and callOutputs.goToNext() in a while loop. This first one is always retrieved without issues. The second one however will throw a `Column 'xyz' does not exist` error when the first resultset happens to contain a column xyz that it does not share with the second resultset retrieved. Only when the second and any other resultset after that have the exact same column set, with all columns arranged in the same order, no problems arise. But often this is not the case.
The bug is thus that hibernate tries to map any consecutive resultset to the same column set that existed in the first resultset. I don't know why it tries to do this. It reminds me of another functionality where Hibernate casts one resultset to a predefined entity. But it shouldn't do that here, because it is simply not instructed to do so.
Here are two threads on stackoverflow and dba that also report this problem.
Database: MySql 8.0, Hibernate 4.3.5