Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exists() doesn't work with OpenJPA #83

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

exists() doesn't work with OpenJPA #83

mwalter opened this issue Jan 17, 2012 · 2 comments

Comments

@mwalter
Copy link

@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
Copy link
Member

@timowest 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
Copy link
Member

@timowest 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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants