diff --git a/crud-framework-core/src/main/java/dev/krud/crudframework/crud/hooks/interfaces/MultiFieldChangeHook.kt b/crud-framework-core/src/main/java/dev/krud/crudframework/crud/hooks/interfaces/MultiFieldChangeHook.kt index fd3c888..60e7e7b 100644 --- a/crud-framework-core/src/main/java/dev/krud/crudframework/crud/hooks/interfaces/MultiFieldChangeHook.kt +++ b/crud-framework-core/src/main/java/dev/krud/crudframework/crud/hooks/interfaces/MultiFieldChangeHook.kt @@ -43,6 +43,7 @@ abstract class MultiFieldChangeHook>( @Suppress("UNCHECKED_CAST") private fun makeImmutable(entity: Entity): Entity { val proxyFactory = ProxyFactory(entity) + proxyFactory.isProxyTargetClass = true proxyFactory.addAdvice(MethodInterceptor { invocation -> if (invocation.method.name.startsWith("set")) { throw UnsupportedOperationException("Cannot modify the original entity inside a MultiFieldChangeHook callback")