title: JPA Lazy loading is not working in Spring boot
body: <p>I googled a lot and It is really bizarre that Spring Boot (latest version) may not have the lazy loading is not working. Below are pieces of my code:</p>
  
  <p><strong>My resource:</strong></p>
  
  <pre><code> public ResponseEntity&lt;Page&lt;AirWaybill&gt;&gt; searchAirWaybill(CriteraDto criteriaDto, @PageableDefault(size = 10) Pageable pageable{
  airWaybillService.searchAirWaybill(criteriaDto, pageable);
          return ResponseEntity.ok().body(result);
  }
  </code></pre>
  
  <p><strong>My service:</strong></p>
  
  <pre><code>@Service
  @Transactional
  public class AirWaybillService {
  
  //Methods
  
   public Page&lt;AirWaybill&gt; searchAirWaybill(AirWaybillCriteriaDto searchCriteria, Pageable pageable){
      //Construct the specification
              return airWaybillRepository.findAll(spec, pageable);
     }
  }
  </code></pre>
  
  <p><strong>My Entity:</strong></p>
  
  <pre><code>@Entity
  @Table(name = "TRACKING_AIR_WAYBILL")
  @JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@airWaybillId") //to fix Infinite recursion with LoadedAirWaybill class
  public class AirWaybill{
  //Some attributes
      @NotNull
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "FK_TRACKING_CORPORATE_BRANCH_ID")
      private CorporateBranch corporateBranch;
  }
  </code></pre>
  
  <p>And when debugging,  I still getting all lazy loaded attributed loaded. See image below.</p>
  
  <p><a href="https://i.stack.imgur.com/EduHY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EduHY.png" alt="enter image description here"></a></p>
  
  <p>One of my questions is could Jackson be involved in such behaviour?
  Is there any way that I may have missed to activate the lazy loading?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Another question, could the debugger be involved in ruining the lazy loading?</p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>For <strong>specification</strong> build, I have :</p>
  
  <pre><code>public static Specification&lt;AirWaybill&gt; isBranchAirWayBill(long id){
      return new Specification&lt;AirWaybill&gt;() {
          @Override
          public Predicate toPredicate(Root&lt;AirWaybill&gt; root, CriteriaQuery&lt;?&gt; query, CriteriaBuilder cb) {
              return cb.equal(root.join("corporateBranch",JoinType.LEFT).get("id"),id);
          }
      };
  }
  </code></pre>