Describe how to use native queries in Quarkus #478
Labels
Campus_21_4_quarkus
documentation
Guides, tutorials, readmes, etc.
enhancement
New feature or request
As described in the repository guide, native queries are currently not supported in Quarkus using
@Query
annotation. However, native queries are an important feature in real live projects. We should show an alternative way to implement native queries in Quarkus usingcreateNativeQuery
directly from theEntityManager
.We should also show a way to avoid the fragment approach and use default methods for custom implementations directly in the repository interface.
This issue is a replacement of the original issue in the devonfw-microservices repository:
As discussed in #37 with spring-data-jpa we do not have support for native queries inside quarkus.
From real life projects (even with quarkus) we have the feedback that native queries are also an important feature.
As the OCX team told me they have it in all of their quarkus apps it must be supported by JPA/Hibernate in quarkus.
If for some reason it is not (yet) supported by spring-data-jpa in quarkus we should clarify:
@Query
annotation will be possible`createNativeQuery
method.Side node for the second bullet: The Fragment-Approach is kind of odd to me as you always need 3 types for one thing (repo interface, fragment interface, fragment implementation). The initial benefit of spring-data-jpa is to have just one thing which is the repository interface. Ideally you should be able to write default methods for custom implementations directly in the repo interface what already works. However, to avoid exposing the EntityManager via the Repository interface we can not access it from default methods in the interface.
The text was updated successfully, but these errors were encountered: