"ORA-00907: missing right parenthesis" when using exists subquery with Oracle

Description

Using the Criteria API the statement sent to the database has a syntax error because of left parenthesis between keywords "and" and "exists".

See also https://forum.hibernate.org/viewtopic.php?f=1&t=1043907.

Environment

Wildfly 10.1., Oracle 11 database

Activity

Show:
Christian Beikov
February 28, 2017, 11:45 PM

Could you try with subquery.select( criteriaBuilder.literal(1) ); to make sure the parenthesis of the embedded id is not problematic?

Frank Langelage
March 9, 2017, 1:48 PM

Indeed, replacing the selecting of the compound primary key fields by selecting constant value 1 does solve problem.
I'm quite sure I tested this before changing the genrated SQL query by hand when I created the question in the forum.

Assignee

Unassigned

Reporter

Frank Langelage

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure