Let me provide more info on my problem as it likely has a different cause than clonq's...
I'm using XMLBeans and they produce an Interface and a single concrete class for POJOs. I'm beyond the default-constructor XMLBean/Hibernate problems (needing both ClassPersister and Interceptor) and have found that I need to provide mappings for both interface and class even though they differ only by class name.
The root of my problem is that the interface's EntityPersister is used to create the SQL aliases and in EntityLoader.loadFromResultSet method the class' EntityPersister is used. That'd be fine, but the name of my formula property differs in the two EntityPersister's
propertyColumnAliases field. The interface's uses
f0_ and the class' uses
f1_ so an Invalid Column error is thrown when the POJO is hydrated.
I'll keep digging for why they differ, but I was hoping someone could tell me that my mapping approach is wrong. I'd prefer just mapping the interface only. I can't use subclass as I don't have a discriminator and I can't use joined-subclass as there is just one table required (and interface and concrete mapping are identical).
Is there a way to only map one or the other rather than duplicating each mapping for every persistable POJO? Here is my code where I deal only with the DirectDepositAccount interface rather than specifically referring to the DirectDepositAccountImpl class:
Code:
hibernateTx = hibernateSession.beginTransaction();
ddAccount = (DirectDepositAccount)hibernateSession.get(
DirectDepositAccount.class, (Serializable)id);
hibernateTx.commit();
Thanks for any advice you have!