I have a join reference like following for which the first join expression is constructed by the JPA API automatically.
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<Tuple> c = cb.createTupleQuery();
Root<Demand> demands = c.from(Demand.class);
Join<Demand, Metadata> joinMetadata = demands.join("metadatas", JoinType.LEFT);
but, I would like to add an aditional condition to my joinMetadata like Metadata.type="AFFECTATION_KEY" but I don't know how.
Many thanks for any help