Closed
Description
A very nice—and extremely underused—feature of the static metamodel is the ability to write:
@OneToMany(mappedBy=Item_.ORDER)
Set<Item> items;
which is a lot more typesafe than:
@OneToMany(mappedBy="order")
Set<Item> items;
But we could take this further. We could have the static metamodel include string-valued constants for named queries, named entity graphs, and even SQL result set mappings.
So you could write, for example:
em.createQuery(Book_.QUERY_ALL_BOOKS).getResultList();
Hibernate 6.3 already supports this.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done
Activity