Jul 20th, 2012, 08:53 AM
Understanding Spring Data JPA repositories common to all entities
I am in reference to the following Spring documentation: http://static.springsource.org/sprin...l-repositories
I am trying to understand the logic behind Jpa custom repositories as described above.
My guess is that I have to create a UserRepository interface (in my case User is the specific entity) extending the MyRepository interface and then supply an implementation for it with the proper parameter types. I then have one repository per entity each sharing a number of common methods defined in the MyRepository interface.
This raises a few questions:
One: What if I am performing operations across several entities: which repository do I use?
Two: Does Spring Data Jpa allow for repositories without any type parameters?
Tags for this Thread