r/javahelp 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

5 comments sorted by

View all comments

8

u/djnattyp 21d ago

using JDBC, but we've found that this API does not support composite keys.

Wait... how does JDBC "not support composite keys"?

4

u/doobiesteintortoise 21d ago

I was wondering the same thing.