In the db there is a table (repo) which uses an identity column (repo_id) for the primary key of the table.
In the db there is a view (bitbucket_repo) which uses the repo table and in the view there is the repo_id column.
We need to insert into bitbucket_repo which of course writes to table repo.
in Hibernate version 5.2.17 it would generate a SQL of:
It’s unfortunate that Oracle doesn’t support the default keyword in this context, but this change was done to fix HHH-13104.
If you are sure that you don’t have entities that are composed of just identifier/PK columns, you can override the OracleDialect to return a subtype of Oracle12cIdentityColumnSupport in Dialect#getIdentityColumnSupport(), which will then return null for getIdentityInsertString().
That way, you can get rid of the identifier column.
Thanks for sharing, I was wondering if that could work, but wasn’t sure and didn’t want to suggest something that might not work, but happy to hear this works for you. FTR, this is using the org.hibernate.annotations.Generated annotation.