Multi join query fails because of extra comma's

Description

I'm using EntityGraphs to create a loadgraph to be used for a fetch.
The entity graph goes 2-3 levels deep on some objects, including subgraphs.

The generated SQL on the select query contains a couple of comma's (,) between some of the left outer joins that cause the query to fail.

Please not that when I remove the subgraph and don't go more than 1 level deep, the problem goes away.

The Graph on the main object looks like this:

BrandProductOffer.java

Product.java

Brand.java

EventType.java

JpaRepository.java

And this is the SQL it generates, notice how 2 of the join lines have a trailing comma:

Environment

Oracle Driver ojdbc6

Activity

Show:
Markus Karnik
September 23, 2014, 5:57 PM

Same effekt with this EntityGraph:

Entity.java

I think the problem is at org.hibernate.hql.internal.ast.SqlGenerator, line 328

SqlGenerator.java

The expression " right.getRealOrigin() == left" is false and the writeCrossJoinSeparator function is called.

SQL Query is:

query.sql

Brett Meyer
January 7, 2015, 4:39 PM

Closing – no test case provided and no further responses.

Assignee

Unassigned

Reporter

Martijn Spronk

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure