Below is my database entity
package org.example.api.entidades;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Entity
@Getter
@Setter
@Table(name = "terceiros")
public class TerceiroEntidade {
@Id
private String cnpj_cpf;
private String nome;
private String tipo;
private String estado;
}
Now we have the controller
@PutMapping("/update")
public Object update(@RequestBody TerceiroEntidade terceiro){
terceiroService.findById(terceiro.getNome());
return terceiroService.updateTerceiro(terceiro);
}
the problem is I can't use any getters from lombok, terceiro.getNome() returns me an error Cannot resolve method 'getNome' in 'TerceiroEntidade'
.
You may get this situation.(no getter and setter)
Please refer previous answer for Intellij : Can't compile project when I'm using Lombok under IntelliJ IDEA Also, we could get generic reference from Setting up Lombok with Eclipse and Intellij