[hibernate-dev] [OGM] JPQL support

Gunnar Morling gunnar at hibernate.org
Sun Oct 20 11:46:23 EDT 2013


Hi Guillaume,

As you say JPQL support is basically not yet implemented in
OgmEntityManager.

There is already some code in this class which obtains an OgmSession for a
given OEM (getDelegate(), buildOgmSession()). So I think one could
implement createQuery() either by delegating to OgmSession#createQuery() or
implement it by using QueryParserService directly, it in a similar way to
OgmSession#createQuery(). Not sure what would be better. If you're just
looking for an ad-hoc solution, you may invoke createQuery() on the object
returned from getDelegate() of your OEM instance.

--Gunnar



2013/10/20 Guillaume SCHEIBEL <guillaume.scheibel at gmail.com>

> Hello,
>
> I can confirm that JPQL queries are only working if they are executed from
> a org.hibernate.Session. If we want to run them from the entity manager, we
> get a OGM-21 thrown from the OgmEntityManager.createQuery(String query)
> method.
>
> How can wa / I make it work ?
>
> Thanks
> Guillaume
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>


More information about the hibernate-dev mailing list