Do you think it is necessary to mark id fields with insertable = false and updatable = false?

Do you think it is necessary to mark id fields with insertable = false and updatable = false?

I haven’t done so many people yet, but today I checked one code that used these properties set to false for the id field.

Hi

+3
source share
1 answer

No, absolutely not. It depends on whether you really do not want this field to be saved. In the indicated case, idI assume that this is primary keyfor this object. So, I can think of updatable = falsefor id, but insertable = falseunlikely. You need to check how it is configured otherwise to provide value for this at the time insert.

Java-, , .

+1

Source: https://habr.com/ru/post/1771422/


All Articles