-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Spring Data 3.1 Jakarta Jpa Repository + EntitySpecification + Paging + Entity Graph #1815
Comments
You're probably just missing an annotation. You have to replace your |
@beikov thanks, I've added the annotation and still don't see much difference. It seems to me that Blaze Persistence doesn't extend a typical JpaRepository, is that correct? I'd have to define another EntityView and EntityViewSpecification for that EntityView, then specify this under basePackages and use it separately? |
Trying to build a view in kotlin...
seems to have issues:
Sorry to be a pain, suggestions welcome though. Thanks for any reply. |
You can try playing around with one of the quickstarts to figure out what you might be missing: https://github.com/Blazebit/blaze-persistence#quickstart The error you just posted looks to me as if you were trying to setup a |
I used the quickstart to generate a project, then used that template to create a kotlin project with my setup to see if I could reproduce the issue. This example project showcases the issue:
I don't know if its because of the kotlin code, or because we also have jpa repositories enabled alongside in separate packages or what's going on. Make sure to run |
From a quick look at the project, you should remove the bean for
|
@beikov this is required for creating the entityViewManager as shown in the instructions you linked. Is the entity view manager not required to get the EntityView(s) working? Removing this and the dependent bean entityViewManager (shown in the instructions) yields:
|
The |
@beikov thank you! That fixed it in the demo but somehow not in my main app.. sorry that's a bit confusing, the IDE thinks that one wasn't defined. Curious why autoconfig doesn't setup the other beans by default via @ConditionalOnMissingBean annotation/autoconfig. This would simplify setup, andwould be a non-breaking change. Also default bean scope is singleton, so I don't believe that is necessary. Thank you very much for your timely replies :) |
It just never occurred to me that we could use conditional beans. Would be great if you could contribute that 😀 |
Definitely might.. if I can get it working and used in production I'll have a vested interest in keeping this working and easy to use. Now the demo isn't useful in reproducing my issue so I'll have to bang my head on the wall a while longer. Thanks again for help so far @beikov |
I fixed it, a dumb typo as usual. Thanks again for the help. |
Description
Question about default JpaRepository methods available via spring extensions.
Hey guys, I'm new to Blaze Persistence. I can see that the spring 3.1 support is relatively new, and I'm trying to solve an issue I'm having by integrating with your library. I want to do it optimally, so thus this question.
First, here's the issue I'm trying to solve:
(kotlin)
Here's my code with Vanilla spring data. As you can see, I'm trying to get Pageable working with an Entity Graph and Entity Specification.
Unfortunately, this breaks because it paginates in-memory. I have this setting enabled for efficiency:
spring.jpa.properties.hibernate.query.fail_on_pagination_over_collection_fetch=false
This won't paginate efficiently...
I know I can do this with your Criteria API, however it adds a whole lot of code....
Are there any extension methods for a JpaRepository that allow a findAll with the combo of these 3 with Blaze? I.E. a Jpa Repository interface or something? Or my ability to specify EntityGraph as a parameter instead of an annotation?
I wanted to ask this before re-writing all of this with the CriteriaApi and bloating code more than possibly necessary.
Thanks for any help/clarification!
The text was updated successfully, but these errors were encountered: