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

org.hibernate.graph.AttributeNode Maven / Gradle / Ivy

There is a newer version: 6.6.2.Final
Show newest version
/*
 * 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 http://www.gnu.org/licenses/lgpl-2.1.html
 */
package org.hibernate.graph;

import java.util.Map;
import jakarta.persistence.Subgraph;

import org.hibernate.metamodel.model.domain.PersistentAttribute;

/**
 * Hibernate extension to the JPA entity-graph AttributeNode contract.
 *
 * @author Strong Liu
 * @author Steve Ebersole
 * @author Andrea Boriero
 */
public interface AttributeNode extends GraphNode, jakarta.persistence.AttributeNode {
	PersistentAttribute getAttributeDescriptor();

	Map, SubGraph> getSubGraphs();
	Map, SubGraph> getKeySubGraphs();

	@Override
	@SuppressWarnings("unchecked")
	default Map getSubgraphs() {
		return (Map) getSubGraphs();
	}

	@Override
	@SuppressWarnings("unchecked")
	default Map getKeySubgraphs() {
		return (Map) getKeySubGraphs();
	}

	 void addSubGraph(Class subType, SubGraph subGraph);
	 void addKeySubGraph(Class subType, SubGraph subGraph);

	SubGraph makeSubGraph();
	SubGraph makeKeySubGraph();

	 SubGraph makeSubGraph(Class subtype);
	 SubGraph makeKeySubGraph(Class subtype);
}