I wonder if there a way to optimize the process of generating JPA Query (JPQL), instead of using native one.
for simplicity my model looks like below: