How to make an Entity read-only?

后端 未结 9 1281
情歌与酒
情歌与酒 2020-12-03 00:43

What is the proper way to make an Entity read-only with JPA ? I wish my database table to never be modified at all programmatically.

I think I understand that I sho

9条回答
  •  一向
    一向 (楼主)
    2020-12-03 01:04

    IIRC you could set every field to insertable = false and updatable = false in your @Column annotations, but I'm sure there must be a better method... :)

    I don't suppose this helps?

提交回复
热议问题