Closed
Description
Please, add support for alias in deleteFrom, otherwise there is no way of using it with exists condition when there are ambiguous columns.
deleteFrom(ENTITY_A).
where(notExists(
select(ENTITY_B.id).from(ENTITY_B).where(ENTITY_B.a_id, isEqualTo(ENTITY_A.id))))
.build().render(RenderingStrategies.MYBATIS3);
If columns A.id & B.a_id have the same name (let's say 'aId'), the resulting sql doesn't work as confuse the column from A with the one in B. This is translated to:
delete from A where not exists (select id from b where aId = aId);
It doesn't matter if an alias is used for B, it's still considering the right part of the equal a column from B:
delete from A where not exists (select id from b as alias where alias.aId = aId);
Metadata
Metadata
Assignees
Labels
No labels