Hibernate 6.6 includes a complete implementation of the current Jakarta Data 1.0 Release Candidate. As https://in.relation.to/2024/04/18/jakarta-data-1/[discussed here], our implementation:
For more information, please see the brand-new _Hibernate Data Repositories_ link:{docs-url}/repositories/html_single/Hibernate_Data_Repositories.html[documentation].
[[concrete-proxy]]
== @ConcreteProxy
6.6 also provides a new `@ConcreteProxy` annotation intended as an improved replacement for the deprecated `@Proxy` and `@LazyToOne` annotations. Indicates that lazy references should be instantiated as the concrete type rather than the referenced type.
Historically, Hibernate would create a lazy proxy for `loaded` of type `Payment`. Attempts to cast that reference to `CardPayment` would result in a casting error. `@ConcreteProxy` forces Hibernate to resolve the actual, concrete type and create a proxy of that type instead -
IMPORTANT: Hibernate will try a number of different ways to determine the concrete type, but may ultimately have to fall back to hitting the database which might have an effect on performance.