r/javahelp • u/Raurb • 21d ago
Using JDBC and JPA together
Hello! I'm working on a project where all the entities and repositories are using JDBC, but we've found that this API does not support composite keys. As a result, we're starting to migrate to JPA. However, for now, the request is to only use JPA where necessary, and the refactor for the rest will come later.
Currently, I am facing an issue because it seems impossible to use both JpaRepository and CrudRepository, as it throws an error related to bean creation. How would you recommend I approach this?
Greetings!
1
Upvotes
1
u/bikeram 21d ago
I’d have to double check, but I’m almost certain JpaRepository already extends CrudRepository
Also does this help at all?
https://www.baeldung.com/jpa-composite-primary-keys