In a Spring Data JPA environment, you may want to retrieve the domain type of the repositories defined in your application. This tutorial will show two ways to retrieve Spring JPA repository domain type.
Using Repositories
Spring data commons provides the class Repositories to handle JPA repositories. You can use it to retrieve the domain type of each repository as below :
Using DefaultRepositoryMetadata
Spring data commons provides also DefaultRepositoryMetadata to retrieve repositories information. Below the usage :
An example of usage is available on Github. Download the source