Hi there,
I have a persistent class
eg.orm.A with a nonpersistent wrapper subclass
eg.bl.AWrapper, which I created to contain business logic methods and some (nonpersisted) fields. When I try to save an instance of the subclass as follows:
Code:
Session s = util.getSessionFactory().openSession();
AWrapper w = new AWrapper();
w.calculateFieldValues(); // sets values of inherited persistent fields
s.save(w);
s.close();
I get
Code:
org.hibernate.MappingException: Unknown entity: eg.bl.AWrapper
. This happens even if I try to cast it to the mapped superclass A.
In the past I've gotten around this problem by having AWrapper encapsulate rather than extend A. In this case, though, A has so many fields that I'd rather not if I can avoid it. I don't want or need to make AWrapper persisent.
Any suggestions?
Thanks in advance,
Eric