I tested via Hibernate 5.4.10 and got some basic conclusions as following:
- It seems Hibernate is working as expected, so if insertable = false, updatable = false, the column in question won’t show up in both insert and update SQL statement;
- It seems your demo testing case passes for List case, though the exception is thrown when the list is fetched (seems your testing case only covers saving). It seems Hibernate is complaining in a readable way;
- It seems your demo testing case failed for Map case. Again, it seems Hibernate is complaining in a readable way;
- Maybe Hibernate should complain while saving phase to avoid surprising exception while fetching for the List case, but that seems another issue.
I didn’t test Hibernate 4, though. |