form persisting mulitple models in spring boot

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

form persisting mulitple models in spring boot

teafg327
Hi everyone,
I have a simple example I can't complete with thymeleaf at the moment.
I am using spring boot, jpa, h2, and thymeleaf.
CUSTOMER has id, name, email, List<Item> items, and PaymentMethod card.
ITEM has id, name, price, Customer customer.
PaymentMethod has id, type, Date expDate, Customer customer.

Its a registration form I am having trouble using Thymeleaf ->  as uisng <div th:object="${Customer}">... for example, I have each div for each model in a single form, to a controller that creates the objects. BUT the values never populate with the <th:value="*{name}"> 

I am looking for more tutorials on spring boot, h2, and thymeleaf with more complex relationships between models. Any guidance is most appreciated.