I have an abstract class A and a concrete subclass B. These are mapped as follows:
Code:
<class name="A" table="ta">
<subclass name="B" discriminator-value="B" proxy="B">
Say that I have an instance of B, sampleB, with id 1. By doing
Code:
A sampleA = (A)session.load(cls, new Integer(1));
if I ask
Code:
sampleA instanceof B
using hibernate 2, I get "true", using hibernate 3, I get "false". Both version use the same classes, server, hibernate configuration, appServer, data.
Tracing the load process, the object sampleA returned is actually in both cases an instance of B proxied by CGLIB,
i.e. an
B$$EnhancerByCGLIB$$75bc@3590"B@6fa"
In the migration guide, if I understood correctly, the only reported change which may affect this is the lazy="false" attribute, but by setting it, the issue above remains.
Is it possible to get consistent answers ?