I'm looking for a java library that can translate json input into SQL dynamically.
For example, the library could expect the following json data:
{
"rules": [
{
"field": "firstname",
"value": [
"John",
"Doe"
],
"operator": "in"
},
{
"rules": [
{
"field": "age",
"value": 18,
"operator": "EQUALS"
}
],
"condition": "AND"
}
]
}
And should then be able of translating this into a dynamic sql query:
SELECT * FROM persons where firstname IN ("John", "Doe") AND age = 18;
Is there any existing framework that I could build this upon?