I am having a problem on how to write Join and than select from Application
so I have to entities Application and Deactivated
deactivated has a field:
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "application_id")
private Application application;
And Application has:
@Id
private Long id;
I don't know how describe the problem in words, so i'll just paste whe JPQL:
SELECT a FROM applications a LEFT OUTER JOIN deactivated_applications da on a.id = da.application_id WHERE da.filedeactivated=false;
CODE FOR THE QUERY that i recive params for:
{ CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Application> cq = criteriaBuilder.createQuery(Application.class);
Root<Application> root = cq.from(Application.class);
//SearchQuery to TO SQLsearchQuery to specification, to Predicate
Predicate searchQueryPredicate = null;
if (!searchQuery.getCriteria().isEmpty())
searchQueryPredicate = SqlSearchQuery.of(searchQuery).toSpecification(Application.class).toPredicate(root, cq, criteriaBuilder);}
now i need to get this query running on previous SQL query