4
votes

If I use @Immutable annotation on an entity and add updatable and insertable attributes on @Column annotation, will that be redundant?

@Entity
@Immutable
public class SomeEntity...
{
 @Column(name="xyz" updatable=false, insertable=false)
 private String xyz;
 ...
}
1

1 Answers

2
votes

These are the two method you can use to make your entity immutable. So yes this is redundant. I know that Hibernate (if that is what you use) will make some optimizations on entity annotated @Immutable. I can't tell for the updatable=false.