Attached a runnable testcase. I don't have an Oracle db installed so please someone else try that on that dbms. For H2 it works with hibernate 5.