Boa tarde, estou criando uma API e estou com problemas na hora de realizar a persistência no banco(MariaDB), segue o erro:
com.system.api.model.Pessoa` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
Segue a estrutura:
PROCESSO
@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Entity
public class Processo {
@EqualsAndHashCode.Include
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Integer numero;
@ManyToOne
@JoinColumn(name = "autor_id")
private Autor autor;
private BigDecimal vlrCausa;
}
PESSOA
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "tipo_pessoa")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
public abstract class Pessoa{
@EqualsAndHashCode.Include
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String nome;
private String cpfCnpj;
@Column(name = "tipo_pessoa", insertable = false, updatable = false)
private String tipoPessoa;
AUTOR
@DiscriminatorValue("AUTOR")
@Entity
@Table(name = "Pessoa")
public class Autor extends Pessoa{
}