All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.omnifaces.persistence.service.SubQueryRoot Maven / Gradle / Ivy

There is a newer version: 0.22.J1
Show newest version
package org.omnifaces.persistence.service;

import javax.persistence.criteria.Fetch;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.Root;

/**
 * Fetch joins are not supported in subqueries, so delegate to normal joins.
 */
class SubQueryRoot extends RootWrapper {

	public SubQueryRoot(Root wrapped) {
		super(wrapped);
	}

	@Override
	@SuppressWarnings({ "unchecked", "hiding" })
	public  Fetch fetch(String attributeName) {
		Join join = join(attributeName);
		return join instanceof Fetch ? (Fetch) join : new JoinFetchAdapter<>(join);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy