I've started working on a legacy oracle database and using Spring boot Jpa trying to insert a new row in a table (CHANNELMGR_REQUEST
) without Identity:
This table has a Numeric column (CM_ISN
) and logically could be an Identity candidate, but I could not touch the database for some reason.
I found an existing sequence (CHANNELMGR_SEQ
) that is used for generating value for that CM_ISN
column too.
So I decided to use that sequence and added some annotation in my equivalent POJO as follow and mapped to the sequence to that CM_ISN
column. But not touching the database :
My repository is like this :
While inserting the row, sucessfully invoke the sequence but get exception as bellow :
My questions :
PS: I'm sorry for putting images instead of actual source codes, The reason is because development machine has no access to the internet.