I have JavaFX
Application with TreeTableView
.
I want to show list of products in tree. First level of tree must contain Product.article. Second level of tree must have list of products contains Product.article, like this:
article1/
-- name model sizes
-- name model sizes
article2/
-- name model sizes
-- name model sizes
I have developed this with foreach on List<String article>
but database table on production will be contain over 1000 articles. Each article should have a list of products from database by distinct query. It will be so slow...
Is there any way to get result set of Hibernate query as Map<String article, List<Product>>
?
P.S.: Sorry for my bad English.