hibernate / hibernate-reactive

A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.
https://hibernate.org/reactive
Apache License 2.0
441 stars 92 forks source link

Stateless reactive insert doesn't return the id #2010

Open DavideD opened 1 week ago

DavideD commented 1 week ago

Hibernate ORM stateless insert returns the id:

Object insert(String entityName, Object entity);

The one in Hibernate Reactive should return CompletionStage<Object> but returns CompletionStage<Void>. Same for Mutiny.

The upgrade to ORM 7 seems a good place to apply these changes.

@gavinking Was this a design choice or something that changed over time?

gavinking commented 1 week ago

Um, TBH I don't really recall, but I don't think it's essential. You can always just get the id from the entity itself.