I use spring boot + thymeleaf and mySQL DB I have 3 entities:
- Category
- SubCategory
- Porducts
I would like to show the sum of products in the table
This is the code to show the sum of sub category:
<tbody>
<tr th:each="category : ${categories}">
<td th:text="${category.name}" />
<td th:text="${#lists.size(category.subCategories)}" />
</tr>
</tbody>