document limitation of LazyToOne(NO_PROXY) to non-polymorphic associations

we can roll back this commit if/when we fix the limitation, as proposed:

    https://github.com/hibernate/hibernate-orm/discussions/5591
This commit is contained in:
Gavin 2022-11-21 17:21:15 +01:00 committed by Gavin King
parent 2e02b9a74f
commit a72c8744a8
2 changed files with 8 additions and 0 deletions

View File

@ -49,6 +49,10 @@
* {@code instanceof} and {@link Object#getClass()} work as
* normal, since the concrete type of the entity instance is
* known immediately. This is usually bad tradeoff.
* <p>
* <strong>Currently, Hibernate does not support
* {@code LazyToOne(NO_PROXY)} for polymorphic associations,
* and instead falls back to using a proxy!</strong>
*
* @author Emmanuel Bernard
*/

View File

@ -52,6 +52,10 @@ public enum LazyToOneOption {
* </ul>
* Bytecode enhancement is required. If the class is not
* enhanced, this option is equivalent to {@link #PROXY}.
* <p>
* <strong>Currently, Hibernate does not support this setting
* for polymorphic associations, and instead falls back to
* {@link #PROXY}!</strong>
*/
NO_PROXY
}