Skip to content

Instantly share code, notes, and snippets.

@Abhi-Codes
Created November 20, 2022 08:02
Show Gist options
  • Save Abhi-Codes/1d842875be9e7f837685cf8e522a5fc9 to your computer and use it in GitHub Desktop.
Save Abhi-Codes/1d842875be9e7f837685cf8e522a5fc9 to your computer and use it in GitHub Desktop.
Use Custom SQL function in QueryDSL
QRoles userRolesPath = QRoles.roles1;
BooleanExpression exp = Expressions
.booleanTemplate("json_contains_key({0}, {1})", userRolesPath.roles, Expressions.constant(role))
.isTrue();
Iterable<Roles> lr = rr.findAll(exp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment