Can't make insert with JPA when table Id has virtual column

840 Views Asked by At

I have to map a table using JPA, but this table has a multicolumn key with some of that as Oracle virtual columns. When I try to make the insert, Hibernate (the implementation of JPA that I've used) return to me this error:

"ORA-54013: INSERT operation disallowed on virtual columns"

I've tried @Column(name = "field", insertable = false, updatable = false) on my fields, but because the field is part of a the table multifields key, apparently JPA need to write this field anyway.

I can't modify the DB, i'm searching for a solution that involes only hibernate.

Has anyone encountered the same problem and has a solution?

0

There are 0 best solutions below