title: call service in other service with @autowired , spring boot and i got kinda N+1 problems
body: <pre><code>@Service("StudyHistoryService")
  @Transactional
  public class StudyHistoryServiceImpl implements StudyHistoryService
  {
      @Autowired
      private StudyHistoryDao shDao;
  
  
      @Autowired
      private ReviewNoticeServieImpl rnService;
  
      @PersistenceContext
      private EntityManager em;
  
      @Override 
      public ArrayList&lt;Map&lt;String, Object&gt;&gt; selectAll(long fk_ltskey) throws Exception
      {
          JPAQuery query = new JPAQuery(em);
          QStudyHistoryDto qsh = QStudyHistoryDto.studyHistoryDto; 
  
  
          List&lt;StudyHistoryDto&gt; shDtoList = query.from(qsh)
                                    .where(qsh.ltsDto.ltskey.eq(fk_ltskey))
                                    .orderBy(qsh.cycle.asc(), qsh.dayofschedule.asc())
                                    .list(qsh);
  </code></pre>
  
  <p>When <code>selectAll</code> is working, <code>rnService</code> sends a query at the same time. Even though I made a relationship "lazy loading".</p>
  
  <p>Before I autowired <code>rnService</code> they work lazy loading. But not now.</p>
  
  <ol>
  <li>How can I fix this?</li>
  <li>The way call service in other service I did, is that wrong?
  If so, can you teach me how to call it?</li>
  </ol>