Querydsl SQL: Remove duplicate columns from projection #314
Especially when dealing with multiple column keys, same table may have keys that share columns. For example parent-child relation for table xxx with (a,b) primary key:
create table ex (
Having MappingProjection with nested multi-column mappings for these keys results in an error because select contains a of table ex twice:
child/parentKeyMappings are also MappingProjections. One with (a,b) and the other with (a, c).
I guess you could make an alias for the second mapping (a.as(a2), b) but having Qdsl remove duplicate columns automatically would be so much easier and more intuitive for the user.
The text was updated successfully, but these errors were encountered:
I'd hesitate to remove duplicate projection expressions on the query level, but maybe they could be removed for certain projections such as QTuple and MappingProjection.
Is that ok with you?
…d internally in nearly all query implementations