Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@


import jakarta.persistence.Subgraph;
import org.hibernate.metamodel.model.domain.ManagedDomainType;
import jakarta.persistence.metamodel.ManagedType;
import org.hibernate.Incubating;
import org.hibernate.metamodel.model.domain.PersistentAttribute;

import java.util.Map;
Expand Down Expand Up @@ -51,13 +52,17 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr

/**
* All value subgraphs rooted at this node.
* <p>
* Includes treated subgraphs.
*
* @see jakarta.persistence.AttributeNode#getSubgraphs
*/
Map<Class<?>, ? extends SubGraph<?>> getSubGraphs();

/**
* All key subgraphs rooted at this node.
* <p>
* Includes treated subgraphs.
*
* @see jakarta.persistence.AttributeNode#getKeySubgraphs
*/
Expand Down Expand Up @@ -89,27 +94,49 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr
* Create and return a new value {@link SubGraph} rooted at this node,
* with the given type, which may be a subtype of the value type,
* or return an existing such {@link SubGraph} if there is one.
* <p>
* If the given type is a proper subtype of the value type, the result
* is a treated subgraph.
*
* @param subtype The type or treated type of the value type
*/
<S> SubGraph<S> makeSubGraph(Class<S> subtype);

/**
* Create and return a new value {@link SubGraph} rooted at this node,
* with the given type, which may be a subtype of the key type,
* or return an existing such {@link SubGraph} if there is one.
* <p>
* If the given type is a proper subtype of the key type, the result
* is a treated subgraph.
*
* @param subtype The type or treated type of the key type
*/
<S> SubGraph<S> makeKeySubGraph(Class<S> subtype);

/**
* Create and return a new value {@link SubGraph} rooted at this node,
* with the given type, which may be a subtype of the value type,
* or return an existing such {@link SubGraph} if there is one.
* <p>
* If the given type is a proper subtype of the value type, the result
* is a treated subgraph.
*
* @param subtype The type or treated type of the value type
*/
<S> SubGraph<S> makeSubGraph(ManagedDomainType<S> subtype);
@Incubating
<S> SubGraph<S> makeSubGraph(ManagedType<S> subtype);

/**
* Create and return a new value {@link SubGraph} rooted at this node,
* with the given type, which may be a subtype of the key type,
* or return an existing such {@link SubGraph} if there is one.
* <p>
* If the given type is a proper subtype of the key type, the result
* is a treated subgraph.
*
* @param subtype The type or treated type of the key type
*/
<S> SubGraph<S> makeKeySubGraph(ManagedDomainType<S> subtype);
@Incubating
<S> SubGraph<S> makeKeySubGraph(ManagedType<S> subtype);
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static <R> void setFetchGraph(TypedQuery<R> query, EntityGraph<R> graph)
* @since 7.0
*/
public <S> Subgraph<S> addTreatedSubgraph(Graph<? super S> graph, Class<S> subtype) {
return ((org.hibernate.graph.Graph<? super S>) graph).addTreatedSubGraph( subtype );
return ((org.hibernate.graph.Graph<? super S>) graph).addTreatedSubgraph( subtype );
}

/**
Expand Down
Loading
Loading