exists() doesn't work with OpenJPA #83

Closed
mwalter opened this Issue Jan 17, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@mwalter

mwalter commented Jan 17, 2012

Using the Projectable.exists() method with OpenJPA leads to an exception being thrown by the OpenJPA framework. It seems that OpenJPA cannot cope with "SELECT 1 FROM..." statements. Here's the complete error:

<openjpa-1.2.3-SNAPSHOT-r422266:1053401 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: "1" found at column 8, expected ["ABS", "AVG", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DISTINCT", "LENGTH", "LOCATE", "LOWER", "MAX", "MIN", "MOD", "NEW", "OBJECT", "SIZE", "SQRT", "SUBSTRING", "SUM", "TRIM", "UPPER", ].

The error was raised using OpenJPA 1.2.3.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 17, 2012

Member

I suggest to replace "select 1" in the JPQL rendering of Querydsl with something more standards compliant such as the first column of the first from part.

Member

timowest commented Jan 17, 2012

I suggest to replace "select 1" in the JPQL rendering of Querydsl with something more standards compliant such as the first column of the first from part.

timowest added a commit that referenced this issue Jan 18, 2012

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 7, 2012

Member

released in 2.3.1

Member

timowest commented Feb 7, 2012

released in 2.3.1

@timowest timowest closed this Feb 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment