mysema/querydsl — Issue #83: exists() doesn't work with OpenJPA
Author: mwalter
Created: 2012-01-17 16:10:44+00:00
State: open

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:

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.