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

org.hibernate.graph.spi.RootGraphImplementor Maven / Gradle / Ivy

/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.graph.spi;

import org.hibernate.graph.RootGraph;
import org.hibernate.metamodel.model.domain.spi.EntityTypeDescriptor;
import org.hibernate.metamodel.model.domain.spi.ManagedTypeDescriptor;

/**
 * Integration version of the RootGraph contract
 *
 * @author Steve Ebersole
 */
public interface RootGraphImplementor extends RootGraph, GraphImplementor {
	boolean appliesTo(EntityTypeDescriptor entityType);

	@Override
	@SuppressWarnings("unchecked")
	default boolean appliesTo(ManagedTypeDescriptor managedType) {
		assert managedType instanceof EntityTypeDescriptor;
		return appliesTo( (EntityTypeDescriptor) managedType );
	}

	@Override
	RootGraphImplementor makeRootGraph(String name, boolean mutable);

	@Override
	SubGraphImplementor makeSubGraph(boolean mutable);

	/**
	 * Make an immutable copy of this entity graph, using the given name.
	 *
	 * @param name The name to apply to the immutable copy
	 *
	 * @return The immutable copy
	 */
	default RootGraphImplementor makeImmutableCopy(String name) {
		return makeRootGraph( name, false );
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy