|Teneo and Hibernate's Session.load() issue [message #620158]
||Tue, 29 July 2008 15:59
| Mikhail Kadan
Registered: July 2009
I have EMF model, which defines only one class "A", without any
attrinutes. I map this to DB using Teneo/Hibernate:
A a = TestFactory.eINSTANCE.createA();
Long aId = (Long) session.save(a);
Ok. Then I try to load this object from DB:
A a2 = (A) session.load("A", aId);
Works fine. But I need to load objects from DB not by EMF name, but by
interface/instance name/class. Hibernate provides me with such method:
A a3 = (A) session.load(A.class, aId);
But it fails with:
org.hibernate.MappingException: Unknown entity: test.A
So I look into generated "hibernate.hbm.xml":
<class name="test.impl.AImpl" entity-name="A" ...
So what do I think? Maybe Teneo places invalid value into "entity-name"
attribute for class mapping, so I cannot load classes by interface, and
have to provide name string w/o package specification? Of cource, I can
always get this string by traversing through EPackage.Registry, but its
very perfomance damaging option.
Powered by FUDForum
. Page generated in 0.01581 seconds