Skip to content

Commit ced58cc

Browse files
committed
add some @SInCE annotations and a lil' bit more Javadoc
1 parent 4b106b6 commit ced58cc

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

hibernate-core/src/main/java/org/hibernate/graph/AttributeNode.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,29 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr
6868
*/
6969
Map<Class<?>, ? extends SubGraph<?>> getKeySubGraphs();
7070

71+
/**
72+
* All value subgraphs rooted at this node.
73+
* <p>
74+
* Includes treated subgraphs.
75+
*
76+
* @apiNote This operation is declared with raw types by JPA
77+
*
78+
* @see #getSubGraphs()
79+
*/
7180
@Override
7281
default @SuppressWarnings("rawtypes") Map<Class, Subgraph> getSubgraphs() {
7382
return unmodifiableMap( getSubGraphs() );
7483
}
7584

85+
/**
86+
* All key subgraphs rooted at this node.
87+
* <p>
88+
* Includes treated subgraphs.
89+
*
90+
* @apiNote This operation is declared with raw types by JPA
91+
*
92+
* @see #getKeySubGraphs()
93+
*/
7694
@Override
7795
default @SuppressWarnings("rawtypes") Map<Class, Subgraph> getKeySubgraphs() {
7896
return unmodifiableMap( getKeySubGraphs() );
@@ -81,12 +99,22 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr
8199
/**
82100
* Create and return a new value {@link SubGraph} rooted at this node,
83101
* or return an existing such {@link SubGraph} if there is one.
102+
* <p>
103+
* Note that {@code graph.addAttributeNode(att).makeSubGraph()} is a
104+
* synonym for {@code graph.addSubgraph(att)}.
105+
*
106+
* @see Graph#addSubgraph(jakarta.persistence.metamodel.Attribute)
84107
*/
85108
SubGraph<?> makeSubGraph();
86109

87110
/**
88111
* Create and return a new key {@link SubGraph} rooted at this node,
89112
* or return an existing such {@link SubGraph} if there is one.
113+
* <p>
114+
* Note that {@code graph.addAttributeNode(att).makeKeySubGraph()} is a
115+
* synonym for {@code graph.addMapKeySubgraph(att)}.
116+
*
117+
* @see Graph#addMapKeySubgraph(jakarta.persistence.metamodel.MapAttribute)
90118
*/
91119
SubGraph<?> makeKeySubGraph();
92120

@@ -97,8 +125,13 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr
97125
* <p>
98126
* If the given type is a proper subtype of the value type, the result
99127
* is a treated subgraph.
128+
* <p>
129+
* Note that {@code graph.addAttributeNode(att).makeSubGraph(cl)}
130+
* is a synonym for {@code graph.addTreatedSubgraph(att,cl)}.
100131
*
101132
* @param subtype The type or treated type of the value type
133+
*
134+
* @see Graph#addTreatedSubgraph(jakarta.persistence.metamodel.Attribute, Class)
102135
*/
103136
<S> SubGraph<S> makeSubGraph(Class<S> subtype);
104137

@@ -109,8 +142,13 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr
109142
* <p>
110143
* If the given type is a proper subtype of the key type, the result
111144
* is a treated subgraph.
145+
* <p>
146+
* Note that {@code graph.addAttributeNode(att).makeKeySubGraph(cl)}
147+
* is a synonym for {@code graph.addTreatedMapKeySubgraph(att,cl)}.
112148
*
113149
* @param subtype The type or treated type of the key type
150+
*
151+
* @see Graph#addTreatedMapKeySubgraph(jakarta.persistence.metamodel.MapAttribute,Class)
114152
*/
115153
<S> SubGraph<S> makeKeySubGraph(Class<S> subtype);
116154

@@ -123,6 +161,8 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr
123161
* is a treated subgraph.
124162
*
125163
* @param subtype The type or treated type of the value type
164+
*
165+
* @since 7.0
126166
*/
127167
@Incubating
128168
<S> SubGraph<S> makeSubGraph(ManagedType<S> subtype);
@@ -136,6 +176,8 @@ public interface AttributeNode<J> extends GraphNode<J>, jakarta.persistence.Attr
136176
* is a treated subgraph.
137177
*
138178
* @param subtype The type or treated type of the key type
179+
*
180+
* @since 7.0
139181
*/
140182
@Incubating
141183
<S> SubGraph<S> makeKeySubGraph(ManagedType<S> subtype);

hibernate-core/src/main/java/org/hibernate/graph/Graph.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,17 @@ RootGraph<J> makeRootGraph(String name, boolean mutable)
100100

101101
/**
102102
* Find an existing {@link AttributeNode} by name within this container.
103+
*
104+
* @since 7.0
103105
*/
104106
@Override
105107
<Y> AttributeNode<Y> getAttributeNode(String attributeName);
106108

107109
/**
108110
* Find an existing {@link AttributeNode} by corresponding attribute
109111
* reference, within this container.
112+
*
113+
* @since 7.0
110114
*/
111115
@Override
112116
<Y> AttributeNode<Y> getAttributeNode(Attribute<? super J, Y> attribute);
@@ -145,13 +149,17 @@ RootGraph<J> makeRootGraph(String name, boolean mutable)
145149
* such {@link SubGraph} if there is one.
146150
*
147151
* @see jakarta.persistence.EntityGraph#addTreatedSubgraph(Class)
152+
*
153+
* @since 7.0
148154
*/
149155
<Y extends J> SubGraph<Y> addTreatedSubgraph(Class<Y> type);
150156

151157
/**
152158
* Create and return a new (mutable) {@link SubGraph} representing
153159
* the given subtype of the type of this node, or return an existing
154160
* such {@link SubGraph} if there is one.
161+
*
162+
* @since 7.0
155163
*/
156164
@Incubating
157165
<Y extends J> SubGraph<Y> addTreatedSubgraph(ManagedType<Y> type);
@@ -244,6 +252,8 @@ <X> SubGraph<X> addSubgraph(Attribute<? super J, X> attribute)
244252
* @param type A subtype of the attribute type
245253
*
246254
* @see #addSubgraph(Attribute, Class)
255+
*
256+
* @since 7.0
247257
*/
248258
@Override
249259
<Y> SubGraph<Y> addTreatedSubgraph(Attribute<? super J, ? super Y> attribute, Class<Y> type)
@@ -260,6 +270,8 @@ <Y> SubGraph<Y> addTreatedSubgraph(Attribute<? super J, ? super Y> attribute, Cl
260270
*
261271
* @param attribute An attribute of the represented type
262272
* @param type A subtype of the attribute type
273+
*
274+
* @since 7.0
263275
*/
264276
@Incubating
265277
<AJ> SubGraph<AJ> addTreatedSubgraph(Attribute<? super J, ? super AJ> attribute, ManagedType<AJ> type)
@@ -337,6 +349,8 @@ <AJ> SubGraph<AJ> addSubGraph(PersistentAttribute<? super J, ? super AJ> attribu
337349
* {@link SubGraph} if there is one.
338350
*
339351
* @param attribute A collection-valued attribute of the represented type
352+
*
353+
* @since 7.0
340354
*/
341355
@Override
342356
<E> SubGraph<E> addElementSubgraph(PluralAttribute<? super J, ?, E> attribute);
@@ -352,6 +366,8 @@ <AJ> SubGraph<AJ> addSubGraph(PersistentAttribute<? super J, ? super AJ> attribu
352366
*
353367
* @param attribute A collection-valued attribute of the represented type
354368
* @param type A subtype of the element type
369+
*
370+
* @since 7.0
355371
*/
356372
@Override
357373
<E> SubGraph<E> addTreatedElementSubgraph(PluralAttribute<? super J, ?, ? super E> attribute, Class<E> type)
@@ -368,6 +384,8 @@ <E> SubGraph<E> addTreatedElementSubgraph(PluralAttribute<? super J, ?, ? super
368384
*
369385
* @param attribute A collection-valued attribute of the represented type
370386
* @param type A subtype of the element type
387+
*
388+
* @since 7.0
371389
*/
372390
@Incubating
373391
<AJ> SubGraph<AJ> addTreatedElementSubgraph(PluralAttribute<? super J, ?, ? super AJ> attribute, ManagedType<AJ> type)
@@ -468,6 +486,8 @@ <AJ> SubGraph<AJ> addKeySubGraph(String attributeName, Class<AJ> type)
468486
*
469487
* @param attribute A map-valued attribute of the represented type
470488
* @param type A subtype of the key type
489+
*
490+
* @since 7.0
471491
*/
472492
@Incubating
473493
<AJ> SubGraph<AJ> addTreatedMapKeySubgraph(MapAttribute<? super J, ? super AJ, ?> attribute, ManagedType<AJ> type)

0 commit comments

Comments
 (0)