IntelliJ JPA console will not execute JPQL query for CUBA generated entities

When using the IntelliJ JPA console I’m unable to craft and execute a JPQL query using entity classes built with the CUBA framework. Code completion works up to the point where the entity is first mentioned for example, “select c from el$Customer …”. Code completion stops at this point and I see “red squiggle” under the $ indicating an error. The message basically states it’s expecting something other than $, like a WHERE clause. If I continue on to build the query, without the aid of code completion, the query does not execute. I assigned the datasource in the IDE, so I think I have everything setup properly. Am I doing something wrong or is it not possible to use the IntelliJ JPA console to build and test my queries?

We haven’t tested IntelliJ JPA console yet. Perhaps it does not expect $ in an entity name, which is a proper character, but quite unusual. We’ll try to investigate this issue, thanks for reporting.

Please excuse my comment but we can not access the YoutTrack entry.

I got following exception while executing a select statement on a StandardEntity against a SQL Server DB.

java.lang.RuntimeException: Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.6.2.cuba16): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [7CD8DC7D-B25B-5CAA-11A0-21A99FADB4A5], of class [class java.lang.String], could not be converted to [class [B].
at org.eclipse.persistence.exceptions.ConversionException.couldNotBeConverted(
at org.eclipse.persistence.internal.helper.Helper.buildBytesFromHexString(
at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToByteArray(
at org.eclipse.persistence.internal.helper.ConversionManager.convertObject(
at org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.convertObject(
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.extractPrimaryKeyFromRow(
at org.eclipse.persistence.internal.descriptors...

Sorry, the link is fixed now.

As for the exception, please provide more information on your setting.

Hello Konstantin,

I use an standard cuba project setup.

For the usage of IntelliJ’s JPA console is it necessary to configure the java project by assigning a datasource.

Which kind of setting did you mean?

Hi Mike,
Sorry for the confusion, I didn’t realize that you are talking about exception when executing query in IntelliJ’s JPA console.
Looking at the error message I can suppose that JPA console cannot apply our converter for UUID type. This is understandable because we assign the converter programmatically and there is no way for a tool to recognize it.

Still no progress with it? Would be soo helpful to use IDEA’s console

The console flags up a syntax error with the $ sign, but it can still run the query. The problem I’ve found is that the run fails because the PersistanceUnit cannot see the definitions for the internal Cuba stuff (Sec$User, for example).

It’s still on our roadmap:


I think is very important, especially since Cuba Studio is evolving into an IntelliJ plug-in.

Totally agree.