title: Spring Data: multiple repository interfaces into a single 'repository' service class
body: <p>I have quite some <code>JpaRepository</code> extended Repository interfaces due to the design of the database.</p>
  
  <p>In order to construct a simple object i.e <code>Person</code> I have to make method calls to about 4 - 5 repositories just because the data is spread like that throughout the database. Something like this (pardon for pseudocode):</p>
  
  <pre><code>@Service
  public class PersonConstructService {
  
      public PersonConstructService(Repository repository,
                                    RepositoryTwo repositoryTwo,
                                    RepositoryThree repositoryThree) {
  
          public Person constructPerson() {
              person
                  .add(GetDataFromRepositoryOne())
                  .add(GetDataFromRepositoryTwo())
                  .add(GetDataFromRepositoryThree());
  
              return person;
          }
  
          private SomeDataTypeReturnedOne GetDataFromRepositoryOne() {
              repository.doSomething();
          }
  
          private SomeDataTypeReturnedTwo GetDataFromRepositoryTwo() {
              repositoryTwo.doSomething();
          }
  
          private SomeDataTypeReturnedThree GetDataFromRepositoryThree() {
              repositoryThree.doSomething();
          }
      }
  }
  </code></pre>
  
  <p><code>PersonConstructService</code> class uses all these interfaces just to construct a simple <code>Person</code> object. I am calling these repositories from different methods inside the <code>PersonConstructService</code> class. I have thought about spreading this class into multiple classes, but I do not think this is correct.</p>
  
  <p>Instead I would like to use a <code>repositoryService</code> which would include all the repositories listed necessary for creation of a <code>Person</code> object. Is that a good approach? Is it possible in Spring? </p>
  
  <p>The reason I am asking is that sometimes the count of injected Services into a class is about 7-8. This is definitely not good. </p>