Hi,
I use Hibernate and JBPM, here is my architecture :
java : sequenceNode inherited from node
hbm : sequenceNode mapped as subclass of node with discriminator and a proxy (to enable cast). node as declared in JBPM.
I had an exception when initializing hibernate.
MappingException("proxy must be either an interface, or the class itself: SequenceNode)
After debug :
SequenceNode with its proxy is well initialized
Node without declared proxy launch an exception.
I saw in PojoEntityTuplizer.java (the class that launch an exception) the following code in buildProxyFactory() :
Code:
Iterator iter = persistentClass.getSubclassIterator();
while ( iter.hasNext() ) {
Subclass subclass = ( Subclass ) iter.next();
Class subclassProxy = subclass.getProxyInterface();
Class subclassClass = subclass.getMappedClass();
if ( subclassProxy!=null && !subclassClass.equals( subclassProxy ) ) {
if ( !proxyInterface.isInterface() ) {
throw new MappingException(
"proxy must be either an interface, or the class itself: " +
subclass.getEntityName()
);
}
proxyInterfaces.add( subclassProxy );
}
}
Why do hibernate test proxyInterface.isInterface() instead of subclassProxy.isInterface() ? Indeed, this is the subclassProxy which is added.
Actually I can't cast a node$$EnhancedByCGlib to a sequenceNode.
(I don't have access at the session object when I want to cast)
Any clue for me ?