First: Foreign key relationship are not only for navigating. They mainly serve to ensure that no spurious values are introduced in the relationship. They also may help the database for query optimization. I would advise you to reconsider that.
Anyway, for creating a query that uses several unrelated entities, you need to put them as from
(root
) entities (as you would do in SQL or JPQL)
SELECT .... FROM Link l, Training t WHERE l.attribute = t.attribute;
Root<Link> rootLink = criteriaQuery.from(Link.class);
Root<Training> rootTraining = criteriaQuery.from(Training.class);
...
criteriaQuery.where(
criteriaBuilder.equal(rootLink.get(link_.linkAttribute), trainingLink));