I have a Grails (v. 3.3.8) app with some scaffolded views which are based on tables in my Oracle 12c database. It all works well with a naive incremental ID generator but in order for it to work 100% according to the specification, I need to have it take the ID's from the database's sequences. For every table named A_B_C
, I have a corresponding sequence named A_B_C_SEQ
.
So normally, with SQL, I would get the next ID with a query like this: select A_B_C_SEQ.nextVal as seq from dual;
. How do I go about translating it to Grails/GORM, so that it uses the sequence as well?