ao disparar a requisição me deparo com o seguinte erro:
org.hibernate.query.QueryTypeMismatchException: Specified result type [boolean] did not match Query selection type [med.voll.api.domain.paciente.Paciente] - multiple selections: use Tuple or array at org.hibernate.query.spi.AbstractSelectionQuery.throwQueryTypeMismatchException(AbstractSelectionQuery.java:352) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at org.hibernate.query.spi.AbstractSelectionQuery.verifyResultType(AbstractSelectionQuery.java:342) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at org.hibernate.query.spi.AbstractSelectionQuery.checkQueryReturnType(AbstractSelectionQuery.java:290) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at org.hibernate.query.spi.AbstractSelectionQuery.visitQueryReturnType(AbstractSelectionQuery.java:232) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at org.hibernate.query.sqm.internal.QuerySqmImpl.(QuerySqmImpl.java:263) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at org.hibernate.internal.AbstractSharedSessionContract.createCriteriaQuery(AbstractSharedSessionContract.java:1343) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:1304) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:120) ~[hibernate-core-6.2.7.Final.jar:6.2.7.Final] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
pelo que parece e algo na classe paciente:
package med.voll.api.domain.paciente;
import jakarta.persistence.; import lombok.; import med.voll.api.domain.endereco.Endereco;
@Getter @EqualsAndHashCode(of = "id") @NoArgsConstructor @AllArgsConstructor @Entity(name = "Paciente") @Table(name = "pacientes") public class Paciente {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String nome;
private String email;
private String cpf;
private String telefone;
@Embedded
private Endereco endereco;
private Boolean ativo;
public Paciente(DadosCadastroPaciente dados) {
this.ativo = true;
this.nome = dados.nome();
this.email = dados.email();
this.telefone = dados.telefone();
this.cpf = dados.cpf();
this.endereco = new Endereco(dados.endereco());
}
public void atualizarInformacoes(DadosAtualizacaoPaciente dados) {
if (dados.nome() != null)
this.nome = dados.nome();
if (dados.telefone() != null)
this.telefone = dados.telefone();
if (dados.endereco() != null)
endereco.atualizarInformacoes(dados.endereco());
}
public void excluir() {
this.ativo = false;
}
}