Open hantsy opened 1 year ago
/cc @FroMage (panache), @evanchooly (kotlin), @geoand (kotlin), @loicmathieu (panache)
I am pretty sure we already have an issue for this, but I'm on a phone now so it's hard to check
We already have this in the quarkus-hibernate-reactive-panache-kotlin
@geoand I do not find this in mongo kotlin support. https://github.com/hantsy/quarkus-sandbox/blob/master/mongodb-kotlin-co/src/main/kotlin/com/example/PostRepository.kt
The issue never mentioned Mongo to begin with, but yeah, good point.
I'll reopen the issue and fix the title.
@geoand Why the common Repository interfaces are not shared in all data storage solutions? like Spring Data and Micronaut Data.
@hantsy this was a choice we made a long time ago when building MongoDB With Panache. At the time, we was not sure that the two implementations will offers the same methods, and in fact some methods are different on MongoDB with Panache than Hibernate with Panache. At Quarkus, we also don't like to have too many abstraction (do you already try to browse the code of Spring Data ... you'll know what I means ...). We also fear that it will give the false impression that MongoDB With Panache is an ODM or even worth a JPA implementation ...
We already have this in the
quarkus-hibernate-reactive-panache-kotlin
@geoand I can not find the Coroutines repository support here, https://github.com/quarkusio/quarkus/tree/3.2.2.Final/extensions/panache/hibernate-reactive-panache-kotlin/runtime/src/main/kotlin/io/quarkus/hibernate/reactive/panache/kotlin
You are right... I thought I saw some Kotlin suspend functions, but I can't find them know... @evanchooly what's the status of Hibernate Reactive + Kotlin Coroutines?
I don't know that any work has been done on HR and kotlin. HR was pretty new last time I did any such work and I just haven't gotten around to it. Reactive isn't really my forte so I'd have to do a bit of research. It's probably as much as work as the others, though, so we have a pretty solid game plan for such things.
@geoand BTW, why we need a kotlin variant of PanacheRepository?
In a Kotlin code project, we can use the Java interface directly. And in Spring Data/Micronaut Data for this case, only adding some extension functions to these Java interfaces.
@evanchooly Have a look at Micronaut Data Kotlin coroutines repository implementations, it also used a build time enhancement, right?
Description
To use the Repository pattern and Kotlin Coroutines, I would like there is Coroutines variant and return Coroutines flavor result directly(no transform in the codes).
In Spring and Micronaut, the basic Kotlin support just uses some Kotlin extensions to extend the functionality on the existing Java API, only Coroutines used standalone API for it.
Implementation ideas
No response