CriteriaQuery<Integer> q = cb.createQuery(Integer.class);
Root<EntityA_Coll_Embed_ToOne> a = q.from(EntityA_Coll_Embed_ToOne.class);
Join<EntityA_Coll_Embed_ToOne, Embed_ToOne> e = a.join(EntityA_Coll_Embed_ToOne_.embed1s);
Subquery<Set> sq1 = q.subquery(Set.class);
Root<EntityA_Coll_Embed_ToOne> a1 = sq1.from(EntityA_Coll_Embed_ToOne.class);
Expression e1 = a1.get(EntityA_Coll_Embed_ToOne_.embed1s);
sq1.select(e1);
Subquery<EntityB1> sq2 = q.subquery(EntityB1.class);
Root<EntityA_Coll_Embed_ToOne> a2 = sq2.correlate(a);
Join<EntityA_Coll_Embed_ToOne, Embed_ToOne> e2 = a2.join(EntityA_Coll_Embed_ToOne_.embed1s);