List of usage examples for javax.persistence.criteria Join getJavaType
Class<? extends X> getJavaType();
From source file:org.jboss.pressgang.ccms.filter.utils.JPAUtils.java
/** * Find Joined Root of type clazz//from ww w . java2 s . c o m * * @param <T> * @param query the criteria query * @param rootClass the root class * @param joinClass the join class * @return the Join */ @SuppressWarnings("unchecked") public static <T, K> Join<T, K> findJoinedType(Root<T> root, Class<T> rootClass, Class<K> joinClass) { Join<T, K> join = null; for (Join<T, ?> j : root.getJoins()) { if (j.getJavaType().equals(joinClass)) { join = (Join<T, K>) j; } } return join; }