Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Query by Class question and potential problem
Query by Class question and potential problem [message #603594] Wed, 14 March 2007 01:48
Jean-Denis Boudreault is currently offline Jean-Denis BoudreaultFriend
Messages: 55
Registered: July 2009
Member
Hello,


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 =
this.getHibernateTemplate().loadAll(MyObjectImpl.class);

what happens is an exception saying that the object MyObject is not
defined.

<exception>Caused by: org.hibernate.MappingException: Unknown entity:
com.something.model.impl.MyObjectImpl</exception>

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
interface at:

pack1.pack2.MyObject

and it will create an implementation at:

pack1.pack2.impl.MyObjectImpl.


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!
Previous Topic:[Teneo] Log output
Next Topic:[Teneo]Multiple inheritance with multi-valued EReferences in second inherited class fails
Goto Forum:
  


Current Time: Wed Apr 24 14:36:59 GMT 2024

Powered by FUDForum. Page generated in 0.03096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top