Please explain about insertable=false and updatable=false in reference to the JPA @Column annotation
Solution 1:
You would do that when the responsibility of creating/updating the referenced column isn't in the current entity, but in another entity.
Solution 2:
Defining insertable=false, updatable=false
is useful when you need to map a field more than once in an entity, typically:
- when using a composite key
- when using a shared primary key
- when using cascaded primary keys
This is IMO not a semantical thing, but definitely a technical one.