Java Code Examples for javax.persistence.criteria.From#getJoins()

The following examples show how to use javax.persistence.criteria.From#getJoins() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractJPATypedQueryVisitor.java    From cxf with Apache License 2.0 5 votes vote down vote up
private Path<?> getExistingJoinProperty(From<?, ?> element, String prop) {
    final Set<?> joins = element.getJoins();
    for (Object object : joins) {
        Join<?, ?> join = (Join<?, ?>) object;
        if (join.getAttribute().getName().equals(prop)) {
            return join;
        }
    }
    return null;
}
 
Example 2
Source File: JpaUtils.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Copy Joins
 * @param from source Join
 * @param to destination Join
 */
public static void copyJoins(From<?, ?> from, From<?, ?> to) {
	for (Join<?, ?> j : from.getJoins()) {
		Join<?, ?> toJoin = to.join(j.getAttribute().getName(), j.getJoinType());
		toJoin.alias(getOrCreateAlias(j));
	
		copyJoins(j, toJoin);
	}
}