In JPA Have another issue for SQLRestriction condition generated before where syntax for example
Select * from table1, table2 on table1.id=table2.id2 (deleted=true) where id= ?
That is the problem because this syntax not usefully and database return wrong records.
https://github.com/spring-projects/spring-data-jpa/issues/3363
This issue already have but it closed.