We're updating the issue view to help you get more done. 

Broken SQL generated for dynamic batch fetching entities with a composite ID

Description

When Dialect.supportsRowValueConstructorSyntaxInInList() return true, a query like the following is generated:

select ... from B b0_ where (b0_.idPart1,b0_.idPart2) in ((?,?,(?,?)

It should be:

select ... from B b0_ where (b0_.idPart1,b0_.idPart2) in ((?,?),(?,?))

When Dialect.supportsRowValueConstructorSyntaxInInList() returns false, a query like the following is generated:

select ... from B b0_ where (b0_.idPart1 and b0_.idPart2 or b0_.idPart1 and b0_.idPart2)

It should be:

select ... from B b0_ where ((b0_.idPart1 = ? and b0_.idPart2 = ?) or (b0_.idPart1 = ? and b0_.idPart2 = ?))

Environment

None

Status

Assignee

Gail Badner

Reporter

Gail Badner

Components

Fix versions

Priority

Major