I have a model that has Material → Material Properties, where Material and MaterialProperty are JPA entites.
My problem is that I want to display all the materials and all of their properties in a table, but in a way that the material is printed 10 times, on 10 different rows, if it has 10 properties (but with a different property on each row). Also, if there are any Materials without any properties, I still want the Material printed
For sake of simplicity:
Material 1 - property 1.1
Material 1 - property 1.2
Material 1 - property 1.3
Material 2 - property 2.1
Material 2 - property 2.2
Material 3 - -
I found a way to sort of do this, by starting the query from the property side, and joining to the materials, but it makes it very difficult to print the Materials that don’t have any properties. Ideally I would be able to start the query by selecting the material and joining it to the properties, using a right join!
Is this possible in JPQL?