get sql support on non EntityManager classes

Hello,

wenn I write, entityManager.createQuery (or NamedQuery), I get sql support from idea.
But we provide createQuery, etc..methods using a base class for all services.
Is it possible to get the sql support there too?

Thanks
Dirk

1 comment
Comment actions Permalink

Yes, using an annotation like this (provided by the bundled IntelliLang plugin):

Query yourCreateQuery(@Language("SQL") String sql) {...}

If you add the annotation text IDEA will show the light bulb and the quickfix there will help you
adding/copying the necessary annotation.jar to your project.

Use "HQL" or "SQL" depending on which type of query your method expects.

If you want to avoid the custom annotation then you could also configure the method parameter
language in "IDE Settings -> Language Injection".


Dirk Reske wrote:

Hello,

wenn I write, entityManager.createQuery (or NamedQuery), I get sql support from idea.
But we provide createQuery, etc..methods using a base class for all services.
Is it possible to get the sql support there too?

Thanks
Dirk

---
Original message URL: http://www.jetbrains.net/devnet/message/5247807#5247807

0

Please sign in to leave a comment.