2

There is a class

@Entity
// @Data or @Getter/@Setter
public class Invenetory {
   @Id
   private UUID id;
   private Sring name;
   @Enumerated(EnumType.String)
   private StatusType status; //remove setter for this field

How to remove setter for that specific field with Lombok configurations

Nursultan
  • 35
  • 4

2 Answers2

5

You can try to set @Setter(AccessLevel.NONE) for the field:

@Entity
@Data
public class Invenetory {
   @Id
   private UUID id;
   private String name;

   @Enumerated(EnumType.String)
   @Setter(AccessLevel.NONE)
   private StatusType status;
}
nkrivenko
  • 1,231
  • 3
  • 14
  • 23
3

You can use

@Setter(AccessLevel.PRIVATE)
private StatusType status;
Ivar
  • 6,138
  • 12
  • 49
  • 61
Taleh Alqayev
  • 51
  • 1
  • 4