Skip to content

For update with outer join fails with PostgreSQL #1565

Closed
@Doan-Van-Tuan

Description

@Doan-Van-Tuan

When building SQL in OuterJoinLoader, Dialect.SupportsOuterJoinForUpdate is not being respected. This causes an exception with Postgres because Postgres will not accept blank lock hint with query containing an outer join such as this query:

SELECT entity0_.Id as id1_0_0_, entity0_1_.Name as name2_1_0_
  FROM Entities entity0_
  left outer join EntityName entity0_1_ on entity0_.Id=entity0_1_.EntityId
  WHERE entity0_.Id=? for update

If we change SqlSelectBuilder to use lock hint for update of entity0_ instead of for update, the query can be executed.

I will create a pull request in next few days.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions