Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
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?