'Hexagonal Architecture with Hibernate Reactive and Quarkus

I am using Hexagonal Architecture, Hibernate Reactive with Panache and Quarkus in a Kotlin Project.

Transaction boundaries are set using @ReactiveTransactional annotation.

The problem is that I had to add the whole Hibernate Reactive with Panache dependency in the domain and application layers just to make this annotation available.

Is there a way to avoid this?

I was hoping it would be possible to create a domain annotation and then in the adapters layer replace it with the @ReactiveTransactional somehow.



Solution 1:[1]

You could remove the annotation from the class, and wrap it into a service, and implement this service in the adapter layer using the annotation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 choquero70