我可以帮您进行翻译。以下是您需要翻译的内容:
我有以下领域对象:
@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;
}
我希望能对名为PropertyDefinition.value的“标题”进行排序。
如何使用Spring Data JPA实现?
Iterable<Item> items = itemRepository.findAll(new Sort("???"));
示例代码可以在这里找到:
https://github.com/altfatterz/sort-poc/
欢迎任何反馈。