Skip to content
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

Creating a new JpaRepository class should make it available when using Spring Data with Hibernate #631

Open
Artur- opened this issue Jan 19, 2025 · 1 comment

Comments

@Artur-
Copy link
Contributor

Artur- commented Jan 19, 2025

It should be possible to create e.g.

public interface Entity1Repository extends  JpaRepository<Entity1, Long>, JpaSpecificationExecutor<Entity1> {
}

and then start to use it. Currently there seems to be no code that listens to creation of these auto-injected types. It is a Spring specific type so it should probably be in the Spring plugin. Not sure what it needs to trigger though

@Artur-
Copy link
Contributor Author

Artur- commented Jan 22, 2025

Test case: https://github.com/Artur-/spring-jpa-test

When you launch DemoApplication and open http://localhost:8080 you should see

Spring knows about these repositories: [interface com.example.demo.Entity1Repository]

After copying Entity1Repository to Entity2Repository, you should see

Spring knows about these repositories: [interface com.example.demo.Entity1Repository, interface com.example.demo.Entity2Repository]

but you still see

Spring knows about these repositories: [interface com.example.demo.Entity1Repository]

Side note: If you use JRebel, then it works as expected so it should be doable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants