File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed
hibernate-reactive-core/src/main/java/org/hibernate/reactive/tuple Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .tuple ;
7
+
8
+ import org .hibernate .Session ;
9
+ import org .hibernate .reactive .mutiny .Mutiny ;
10
+ import org .hibernate .tuple .ValueGenerator ;
11
+
12
+ import io .smallrye .mutiny .Uni ;
13
+
14
+ /**
15
+ * A reactive {@link ValueGenerator} that gives access to a {@link Mutiny.Session}.
16
+ * <p&
10000
gt;
17
+ * This interface needs to extend {@link ValueGenerator} but Hibernate Reactive
18
+ * ignores the method {@link MutinyValueGenerator#generateValue(Session, Object)}.
19
+ * </p>
20
+ *
21
+ * @see StageValueGenerator
22
+ */
23
+ public interface MutinyValueGenerator <T > extends ValueGenerator <T > {
24
+
25
+ @ Override
26
+ default T generateValue (Session session , Object owner ) {
27
+ throw new UnsupportedOperationException ( "Use generateValue(Mutiny.Session, Object) instead" );
28
+ }
29
+
30
+ Uni <T > generateValue (Mutiny .Session session , Object owner );
31
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .tuple ;
7
+
8
+ import java .util .concurrent .CompletionStage ;
9
+
10
+ import org .hibernate .Session ;
11
+ import org .hibernate .reactive .stage .Stage ;
12
+ import org .hibernate .tuple .ValueGenerator ;
13
+
14
+ /**
15
+ * A reactive {@link ValueGenerator} that gives access to a {@link Stage.Session}.
16
+ * <p>
17
+ * This interface needs to extend {@link ValueGenerator} but the non reactive method is ignored by
18
+ * Hibernate Reactive and, unless the default implementation is overridden, it will throw an exception
19
+ * when called.
20
+ * </p>
21
+ *
22
+ * @see MutinyValueGenerator
23
+ */
24
+ public interface StageValueGenerator <T > extends ValueGenerator <T > {
25
+
26
+ @ Override
27
+ default T generateValue (Session session , Object owner ) {
28
+ throw new UnsupportedOperationException ( "Use generateValue(Stage.Session, Object) instead" );
29
+ }
30
+
31
+ CompletionStage <T > generateValue (Stage .Session session , Object owner );
32
+ }
You can’t perform that action at this time.
0 commit comments