Announcement Announcement Module
Collapse
No announcement yet.
Understanding Spring Data JPA repositories common to all entities Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Understanding Spring Data JPA repositories common to all entities

    Hello,

    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?

    Regards,

    J.
Working...
X