Saudações
Estou fazendo uma aplicação em springboot+thymeleaf (ainda sou novato nisto), tenho o seguinte caso:
Existem dois objetos relacionados Owner e Car
No form. de registo do Car, contêm uma combobox que possui uma lista dinâmica de Owner(s)
ao dar o clique para fazer o save encontro-me com o seguinte erro:
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]]
abaixo os screenshot(s):
class Car
Controller do Car