Closed gavinking closed 1 year ago
Oh, wait, I messed up in describing this.
A very nice—and extremely underused—feature of the static metamodel
Actually that "very nice" feature is a feature of our implementation, which is not actually mandated by section 6.2.1.1 of the specification.
But it should be!
Please check out this proposal: https://github.com/jakartaee/persistence/pull/461/commits/ff3f6f9328333cd75004254d4ec54b07c31dc22d
A very nice—and extremely underused—feature of the static metamodel is the ability to write:
which is a lot more typesafe than:
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:
Hibernate 6.3 already supports this.