I have the following association
ObjectA ---Many-to-many---ObjectB (unidirectional A to B)
ObjectC is a subclass of ObjectB
I use lazy initialization, and the same classes as proxies.
I add a set of objectCs to ObjectA and save the graph.
When I read this graph, I loop through the set of ObjectBs (which are in this case all ObjectCs), all of them are of type:
mypackage.ObjectB$$EnhancerByCGLIB$$d991a4fd
I believe this the proxy class. The problem is when I check real instances I get this unexpected result:
instanceof ObjectB returns true (expexted)
instanceof ObjectC returns false ???
Is this normal or am I missing someting?
When I use one-to-many assocaiation, getClass() returns mypackage.ObjectB (Without $$EnhancerByCGLIB$...), and everything works as expected.
|