0
Greetings
I’m doing a springboot+Thymeleaf application (I’m still new to this), I have the following case:
There are two related objects Owner and Car
In the Car registration form. they contain a combobox that has a dynamic Owner(s list)
when clicking to save I encounter the following error:
Failed to convert from type [java.lang.String] to type [@javax.persistence.ManyToOne co.mz.cth.model.Owner] for value '4'; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Provided id of the wrong type for class co.mz.cth.model.Owner. Expected: class java.lang.Long, got class java.lang.String; nested Exception is java.lang.Illegalargumentexception: Provided id of the Wrong type for class co.mz.Cth.model.Owner. Expected: class java.lang.Long, got class java.lang.String]]
below the screenshot(s): class Car
Car controller