Building query dynamically

Viewed 49

I have a requirement where I need to build query dynamically i.e., which columns to select, from which tables and which joins to use.

Is there any existing library that I can use?

I have already looked into Spring Projections but it doesn't serve the purpose. It requires projection (interface) needed to be defined before hand.

I am also looking at JOOQ. It looks like it may serve the purpose but before I dig into this, I wanted to see if there is anything built into Spring or there are any other better option?

P.S: I need queries for Azure SQL Dialect

1 Answers

jOOQ's dynamic SQL support answers pretty much all of your questions. I'm not aware of anything by Spring itself that can model jOOQ's support for complex dynamic SQL

Related