|Query by Class question and potential problem [message #603594]
||Wed, 14 March 2007 01:48
| Jean-Denis Boudreault
Registered: July 2009
i am currently porting my old POJO/hibernate code to
EMF/Teneo/Hibernate. for many queries, i used to query by "load" or
"get" and specifying the class name.
i.e.: List myObjects =
what happens is an exception saying that the object MyObject is not
<exception>Caused by: org.hibernate.MappingException: Unknown entity:
Since this code used to work before teneo, i realized that it was due to
the interface / implementation of EMF.
Basically, if it is in the package "pack1.pack2", the it will create an
and it will create an implementation at:
Teneo gives the interface name to the mapped entity in the hbm.xml file
(i.e. entity-name="MyObject"), and this seems to cause problems when
invoking by class type. If i provide the interface name, then it wont
work since hibernate expects the implementation. but if i use the
implementation, the name does not match the mapped entity.
If i query by string class name (or by query), all works fine. (as
expressed in the examples on the elver site)
my question is: is there a way to query by class type in teneo, or must
we explicitly provide the type by string name? perhaps can we force the
entity name in the hbm file to be the implementation one? and is this a
known limitation or am i missing something?
thanks a lot for your invaluable help!
Powered by FUDForum
. Page generated in 0.01632 seconds