我是 JPA / Hibernate 和 Spring Boot 的新手,现在我已经面临同样的错误超过 6 个小时,这让我发疯。
基本上,这一切都从我的控制器开始
@RestController
@RequestMapping("patientApi")
public class RestPatientController {
public static final Logger LOGGER = LoggerFactory.getLogger(RestPatientController.class);
@Autowired
private PatientService patientService;
[...]
@RequestMapping(value = "/patient/prises_en_charge/{id}", method = RequestMethod.GET)
public ResponseEntity<List<PriseEnCharge>> listAllPrisesEnChargeByPatient(@PathVariable("id") long id) {
Patient currentPatient = patientService.findById(id);
LOGGER.info("Récupération de toutes les prises en charges d'un patient avec id {}", currentPatient);
List<PriseEnCharge> prisesEnCharge = patientService.findAllPrisesEnChargeByPatient(currentPatient);
LOGGER.info("Liste de prises en charge {} ({} elements)", prisesEnCharge, prisesEnCharge.size());
if (prisesEnCharge.isEmpty()) {
LOGGER.debug("La liste des prises en …Run Code Online (Sandbox Code Playgroud)