I just ran into an issue because hibernate 5 switched to SequenceStyleGenerator instead of IdentityGenerator as the default id generation mechanism. Apparently the dialect for DB2 does not override the method getSelectSequenceNextValString.
According to the documentation, you can use NEXT VALUE FOR seqname to retrieve the sequence value even in the select clause.
I can confirm that it works on DB2 10.5. I will also test on 9.7.0 but since the documentation already states that it should work, I don't think this will be a problem.
|