NativeCriteria icon indicating copy to clipboard operation
NativeCriteria copied to clipboard

Union/Union All

Open dhpagani opened this issue 8 years ago • 2 comments

Hi, is there a way to use UNION or UNION ALL between two NativeQueries? I have looked on the source code and didn't found.

Thank you!

dhpagani avatar Jan 05 '17 18:01 dhpagani

I afraid that currently there is no UNION & UNION ALL expressions on the NativeCriteria. Unfortunately I don't have a lot of time to make that change in the near time so the PR would be welcome.

I think it would be good to create UNIONs similar like JOINSs and add them on the NativeCriteria#toSql() part.

Everything is build on the top of the NativeExp so the extension should be easy.

pnowy avatar Jan 08 '17 15:01 pnowy

Thank you! I will try do this week, and also try to add the possibility to use a NativeCriteria object instead of a String main table. With that we can use SQLs like select * from (select * from tables) t where t.a1=1.

Thank you

dhpagani avatar Jan 08 '17 20:01 dhpagani