JPA not working in recently installed IDEA 8

Hi, I just started trying IDEA 8 (currently trying build 9164) and I noticed that there apparently are some problems with JPAQL queries: IDEA doesn't seem to parse/highlight/validate/autocomplete them anymore.

I imported the JPA facet settings from my old idea 7 installation and they seem to be correct: in fact I can see the entities under the persistence unit in the JPA element in the Java EE structure entry, and I can navigate from them to the relevant (annotated) classes.

For instance, on the following code:

List resultList =
            em.createQuery("select m.id from PartnerMonitoringSet m "
                           + "join m.partnerData data "
                           + "join data.partnerDataType t "
                           + "where data.name like :clientId "
                           + "and t.id = :clientIdType ")
                    .setParameter("clientId", clientId)
                    .setParameter("clientIdType", CLIENT_ID_PARTNER_DATA_TYPE)
                    .getResultList();

I get no JPA-related features in the query string. If I accept the "inject language" intention action and explicitly mark that as EJBQL then the syntax highlighting works, but I get no autocompletion, navigation, refactoring, etc.

I also tried removing and recreating the facet, but the problem is still occurring.

Apparently no specific exceptions in the log.

How can I try to fix this?

Thanks,
Davide.

0
4 comments
Avatar
Permanently deleted user

BTW same problem in 9731.

0
Avatar
Permanently deleted user

Hello Davide,

This may be caused by existing IntelliLang configuration.
To fix this:

Quit IDEA
Rename/Move/Delete config/options/IntelliLang.xml
Restart

You will have to manually merge your IntelliLang configuration with the
default one. Otherwise you can go to Settings/Language Injections and
manually setup JPA QL injection for the em.createQuery() method.

Regards,
Gregory Shrago

Davide Baroncelli wrote:

BTW same problem in 9731.

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

0
Avatar
Permanently deleted user

Aaaah, sorry, I had thought it could be IntelliLang related but didn't think about erasing the config file (and a quick search on the forum didn't find anything relevant).

I hope you don't mind if I ask a mildly related question: I noticed that when I attach the @Language annotation to an API parameter declaring that it's expected to receive EJBQL strings, this causes highlight to correctly appear on the usages of the API, but nothing else (i.e. no navigation, autocompletion, etc.).

Is this a known limitation (if so, could it be fixed or is it too difficult?) or something that should work and doesn't?

Thanks again,
Davide.

0
Avatar
Permanently deleted user

Hello Davide,

EJBQL stands for EJB2 QL. JPAQL or HQL should be used for JPA/Hibernate
QL. JPAQL will automatically decide whether HQL dialect should be used.

Gregory Shrago

Davide Baroncelli wrote:

Aaaah, sorry, I had thought it could be IntelliLang related but
didn't think about erasing the config file (and a quick search on the
forum didn't find anything relevant).

I hope you don't mind if I ask a mildly related question: I noticed
that when I attach the @Language annotation to an API parameter
declaring that it's expected to receive EJBQL strings, this causes
highlight to correctly appear on the usages of the API, but nothing
else (i.e. no navigation, autocom pletion, etc.).

Is this a known limitation (if so, could it be fixed or is it too
difficult?) or something that should work and doesn't?

Thanks again, Davide.

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

0

Please sign in to leave a comment.