-
Notifications
You must be signed in to change notification settings - Fork 563
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
RepositoryResourceMapping Should Work With Repositories Instead Of PersistentEntities #2276
Comments
I don't think your suggested PR maintains the current semantics of the code. Similarly to what I described [here|https://github.com//pull/2277#issuecomment-1621464781], I'd like to take a step back, see a sample project that shows what is not working as expected and take it from there. Alternatively, adding a test case to the SD REST codebase showing what's not working would work as well. |
Hello Oli, I managed to create a simple project that reproduces the behaviour. It is here: https://github.com/ptahchiev/spring-data-rest-2279 Before you run it here's a little bit of context.
Then the user adds a bunch of modules they need in their
So that is the reason why we need to extend spring-data to make the repositories work with JPA entities that are interfaces, and not classes. In the sample project above you will find:
We also support QueryDSL and for that reason i also need to provide a custom |
Hello, is there any update on this? |
Hello,
up until version 3.3.9 the
RepositoryResourceMappings
class was using theRepositories
object to populate the cache needed for theResourceMetadataHandlerMethodArgumentResolver
as you can see here:https://github.com/spring-projects/spring-data-rest/blob/3.3.9.RELEASE/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java#L69
Then this method was changed to use the
PersistentEntities
as youc an see here:https://github.com/spring-projects/spring-data-rest/blob/main/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java#L69
The
PersistentEntities
object is constructed by trying to locate all thejavax.persistence.metamodel.Metamodel
and thus completely ignores thealternativeDomainTypes
aRepositoryMetadata
may hold.The text was updated successfully, but these errors were encountered: