I have the following domain objects:
@Entity public class Item { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; @OneToMany private List<PropertyDefinition> propertyDefinitions; } @Entity public class PropertyDefinition { @Id private Long id; private final String name; private final String value; }
I would like to sort the elements, for example, "title" with the name PropertyDefinition.value
How can I do this using Spring JPA data?
Iterable<Item> items = itemRepository.findAll(new Sort("???"));
sample code can be found here:
https://github.com/altfatterz/sort-poc/
Any feedback is appreciated.
source share