[hibernate-dev] [OGM] OGM-21 query support

Guillaume SCHEIBEL guillaume.scheibel at gmail.com
Mon Nov 4 12:33:52 EST 2013


Hello,

I have started to work on the support of the JPQL queries from the
EntityManager and I'm facing some difficulties.
I have look into the ORM as a start and so I have created

public class OgmQueryImpl<X> extends AbstractQueryImpl<X> implements
TypedQuery<X> { ... }

Therefore, the AbstractQueryImpl class needs a constuctor
using HibernateEntityManagerImplementor. Because OgmEntityManager is
directly implementing EntityManager it cannot be done directly (HEMI is an
implementation of the EntityManager interface).

So I've tried to switch OgmEntityManager to
extend AbstractEntityManagerImpl (which is an implementation of
HibernateEntityManagerImplementor) but now
OgmEntityManager#getEntityManagerFactory() must return an instance
of EntityManagerFactoryImpl.
The point is OgmEntityManagerFactory is implementing EntityManagerFactory
and HibernateEntityManagerFactory and not EntityManagerFactoryImpl.

I don't want to change the complete class hierarchie if there is a better
option / choice.

So any thoughts ?

Guillaume


More information about the hibernate-dev mailing list