0

On edit an existing entity all fields (except the key) are modifiables. Is there a way to indicate that some field is not modifiable?

javierpaniza
  • 677
  • 4
  • 10

1 Answers1

0

You can declare any property of the view read only using the @ReadOnly annotation:

@ReadOnly
private String name;

Moreover, you can define the property not modifiable only for certain view:

@ReadOnly(forViews="SomeMembersReadOnly")
private String name;

@ReadOnly can also be applied to references:

@ReadOnly @ManyToOne
private Customer customer;

And collections:

@ReadOnly @OneToMany(mappedBy="customer")
private Collection<Invoice> invoices;
javierpaniza
  • 677
  • 4
  • 10