Example usage for javax.persistence.criteria Fetch getFetches

List of usage examples for javax.persistence.criteria Fetch getFetches

Introduction

In this page you can find the example usage for javax.persistence.criteria Fetch getFetches.

Prototype

java.util.Set<Fetch<X, ?>> getFetches();

Source Link

Document

Return the fetch joins that have been made from this type.

Usage

From source file:org.jdal.dao.jpa.JpaUtils.java

/**
 * Copy Fetches//w w  w.  j  a  v  a  2 s .  c  om
 * @param from source Fetch
 * @param to dest Fetch
 */
public static void copyFetches(Fetch<?, ?> from, Fetch<?, ?> to) {
    for (Fetch<?, ?> f : from.getFetches()) {
        Fetch<?, ?> toFetch = to.fetch(f.getAttribute().getName());
        // recursively copy fetches
        copyFetches(f, toFetch);
    }
}

From source file:com.zero.dao.impl.BaseDaoImpl.java

private void copyFetches(Fetch<?, ?> from, Fetch<?, ?> to) {
    for (Fetch<?, ?> fetch : from.getFetches()) {
        Fetch<?, ?> toFetch = to.fetch(fetch.getAttribute().getName());
        copyFetches(fetch, toFetch);/* w w w  .jav  a2s . com*/
    }
}