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

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

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

import java.util.Set;

import javax.persistence.criteria.Fetch;
import javax.persistence.criteria.FetchParent;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.Attribute;
import javax.persistence.metamodel.PluralAttribute;
import javax.persistence.metamodel.SingularAttribute;

/**
 * This class adapts from {@link Join} to {@link Fetch}.
 * This is currently only used by OpenJPA as it doesn't internally consider a Join an instance of Fetch even though they share exactly the same methods.
 */
class JoinFetchAdapter implements Fetch {

	private Join join;

	public JoinFetchAdapter(Join join) {
		this.join = join;
	}

	@Override
	public Attribute getAttribute() {
		return join.getAttribute();
	}

	@Override
	public FetchParent getParent() {
		return join.getParent();
	}

	@Override
	public JoinType getJoinType() {
		return join.getJoinType();
	}

	@Override
	public Set> getFetches() {
		return join.getFetches();
	}

	@Override
	public  Fetch fetch(SingularAttribute attribute) {
		return join.fetch(attribute);
	}

	@Override
	public  Fetch fetch(SingularAttribute attribute, JoinType jt) {
		return join.fetch(attribute, jt);
	}

	@Override
	public  Fetch fetch(PluralAttribute attribute) {
		return join.fetch(attribute);
	}

	@Override
	public  Fetch fetch(PluralAttribute attribute, JoinType jt) {
		return join.fetch(attribute, jt);
	}

	@Override
	@SuppressWarnings("hiding")
	public  Fetch fetch(String attributeName) {
		return join.fetch(attributeName);
	}

	@Override
	@SuppressWarnings("hiding")
	public  Fetch fetch(String attributeName, JoinType jt) {
		return join.fetch(attributeName, jt);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy