Skip to content

Commit d8e08d7

Browse files
committed
[#1741] Change MutinyGenerator#generate return type
We `Uni<?>` we can avoid an additional redundant conversion before returning the value in some situations. For example, if the return value is the result of a native query: ``` return session.createNativeQuery("...", Long.class).getSingleResult(); ``` This is useful because with native queries we don't always know in advance what value will be returned. And using Object.class might cause ClassCastExceptions along the way.
1 parent cc8bff9 commit d8e08d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/tuple/MutinyGenerator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ public Object generate(SharedSessionContractImplementor session, Object owner, O
2121
throw new UnsupportedOperationException( "Use generate(Mutiny.Session, Object, Object, EventType) instead" );
2222
}
2323

24-
public abstract Uni<Object> generate(Mutiny.Session session, Object owner, Object currentValue,
25-
EventType eventType);
24+
public abstract Uni<?> generate(Mutiny.Session session, Object owner, Object currentValue, EventType eventType);
2625
}

0 commit comments

Comments
 (0)