P
P
postya2019-11-05 08:33:54
Spring
postya, 2019-11-05 08:33:54

How to create object models to display them in a table?

I need to make a web application on Spring Boot + Thymeleaf
on the first page, a table with several fields is displayed, for example, name, year of birth, city,
on the second page, full information is displayed, for example, employee name, year of birth, city, residential address, family, phone, postal index)
In the database I have two tables in which one field is associated with a foreign key.
I'm using thymeleaf template engine to display data in a table, but thymeleaf accepts only one object as input.
What is the best way to create database object models?
Make an object model for a database that includes absolutely all fields from two database tables or make two models separately for each database table?
if I do make two different object models, then I will not be able to pass two objects to thymeleaf at the same time in order to get all the fields to display in html
Please advise how to proceed

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question