Estou tendo esse seguinte erro, dizendo: Error creating bean with name 'medicoRepository'
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'medicoController': Unsatisfied dependency expressed through field 'repository': Error creating bean with name 'medicoRepository' defined in med.voll.api.medico.MedicoRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Could not create query for public abstract org.springframework.data.domain.Page med.voll.api.medico.MedicoRepository.findAllAtivoTrue(org.springframework.data.domain.Pageable); Reason: Failed to create query for method public abstract org.springframework.data.domain.Page med.voll.api.medico.MedicoRepository.findAllAtivoTrue(org.springframework.data.domain.Pageable); No property 'findAllAtivo' found for type 'Medico'
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:712) ~[spring-beans-6.0.2.jar:6.0.2]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:692) ~[spring-beans-6.0.2.jar:6.0.2]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:127) ~[spring-beans-6.0.2.jar:6.0.2]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:481) ~[spring-beans-6.0.2.jar:6.0.2]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'medicoRepository' defined in med.voll.api.medico.MedicoRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Could not create query for public abstract org.springframework.data.domain.Page med.voll.api.medico.MedicoRepository.findAllAtivoTrue(org.springframework.data.domain.Pageable); Reason: Failed to create query for method public abstract org.springframework.data.domain.Page med.voll.api.medico.MedicoRepository.findAllAtivoTrue(org.springframework.data.domain.Pageable); No property 'findAllAtivo' found for type 'Medico'
Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract org.springframework.data.domain.Page med.voll.api.medico.MedicoRepository.findAllAtivoTrue(org.springframework.data.domain.Pageable); Reason: Failed to create query for method public abstract org.springframework.data.domain.Page med.voll.api.medico.MedicoRepository.findAllAtivoTrue(org.springframework.data.domain.Pageable); No property 'findAllAtivo' found for type 'Medico'
Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract org.springframework.data.domain.Page med.voll.api.medico.MedicoRepository.findAllAtivoTrue(org.springframework.data.domain.Pageable); No property 'findAllAtivo' found for type 'Medico'
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property 'findAllAtivo' found for type 'Medico'
Bom dia Erick
Vi que existe um ajuste a ser feito na sua classe Medico Repository. Troque o nome do método
//DE:
Page<Medico> findAllAtivoTrue(Pageable paginacao);
//PARA:
Page<Medico> findAllByAtivoTrue(Pageable paginacao);
Bons estudos!
Muito obrigadoooo, funcionou aqui, agradeço demaissssss...