Hi,
Following our recent posts on using Lazy initialization with Hibernate Search, we have one (hopefully) final problem: when we have a complex hierarchy of @IndexedEmbedded and @ContainedIn using polymorphism, we have an exception in the ReflectionHelper.getMemberValue() call of AbstractDocumentBuilder.appendContainedInWorkForInstance().
In our example, we reference a field which is in the child class and the lazy Javassist proxy is based on the parent class, so when you try to get the member value via reflection, you have an exception as the field doesn't exist in the proxy.
We fixed the issue by unproxying the instance before manipulating the object.
Pull request to come, with a test case contributed by my colleague Yoann Rodière (corporate CLA on its way).
|