Criteria API Path to sub-sub-entity id?

If the JPQL you've shown is working, then I'll assume that your ParentEntity is holding a reference to its parent (in a form of parent field of ParentEntity type). Therefore, something like this should work.

If the JPQL you've shown is working, then I'll assume that your ParentEntity is holding a reference to its parent (in a form of parent field of ParentEntity type). Therefore, something like this should work: Path parentId = root. Get(Entity_.

Parent). Get(ParentEntity_. Parent) .

Get(ParentEntity_. Id); Predicate whereParentId = builder. Equal(parentId, selectedParent.getId()); I've done similar thing but for one entity (Customer is child and parent entity at the same time and references its parent through parent field of Customer type) and something like this worked perfectly fine: query.

Select(customer) . Where(criteriaBuilder. Equal( customer.

Get("parent"). Get("parent"). Get("id"), criteriaBuilder.

Parameter(int. Class, "parentId"))); List customers = em. CreateQuery(query) .

SetParameter("parentId", john.getId()).getResultList().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions