Replies: 2 comments 8 replies
-
Can you show how did you manage to address your problem? I'm thinking that we can partially support JPA's criteria API for JDBC/R2DBC and use |
Beta Was this translation helpful? Give feedback.
1 reply
-
I don't think we should be exposing |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was working through an approach to this discussion (#1108) and ended up digging into the code so understand it more now.
What was surprising to me was the large difference between RepositoryOperations, which is effectively what you are using with @repository and named methods (findByNameOrderByStatus etc) and JdbcOperations which is basically everything else.
Naively I thought JdbcOperations was roughly equivalent but lower level, the major difference from a developer usage point of view is that JdbcOperations doesn't seem to support any way to use joins to build projections. If I use
.entityStream(..)
there is no way for me to use all the micronaut-data goodness to create an object graph as the result that is specifically only called when using RepositoryOperations methods likefindStream()
.The reason for this is obvious, with RepositoryOperations it captures all the context in QueryModel like JoinPath to make joins etc to work and power projections, serialises that into an ExecutionMethod (i think its called?) and then uses that detail to construct a PreparedQuery at runtime. It is possible today with a bit of contorting to use RepositoryOperations and PreparedQuery at runtime without actually defining a Repository class or method, and doing that is how i've addressed our need for keyset pagination amongst other unique needs but in doing the work it became clear just how little change would be required to support this out of the box without contortion, which seems like a pretty great outcome? Super powered JdbcOperations.
Whilst most of the bits required to enable this are already there, it would be tinkering with the vital organs of how queries are executed so i'd imagine this would not be a 'PRs welcome' kind of change.
Beta Was this translation helpful? Give feedback.
All reactions