public class GroovyProxyMetaClassDispatcher extends java.lang.Object
ByteBuddy delegation target for getMetaClass() on the generated Groovy proxy.
Hibernate assigns the proxy interceptor after the proxy constructor has run, so any
intercepted method invoked while the constructor is still executing answers Hibernate's stub
value, which is null for getMetaClass(). Groovy trait initializers
($init$) resolve the receiver's metaclass through getMetaClass() from inside
the entity constructor and fail with a NullPointerException on that null.
This dispatcher answers the persistent class's MetaClass while the interceptor is not assigned yet - the same answer GroovyProxyInterceptorLogic gives for an uninitialized proxy - and otherwise leaves the proxy's own answer untouched. Mirrors the Hibernate 7 implementation in grails-data-hibernate7.
| Constructor and description |
|---|
GroovyProxyMetaClassDispatcher(java.lang.Class<?> persistentClass) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public java.lang.Object |
intercept(java.util.concurrent.Callable<?> superCall) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |