0
@Entity
@Table(name = "report_type")
public class ReportType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private String id;

    @NotNull
    @Column(name = "report_name")
    private String reportName;

    @NotNull
    @Column(name = "active")
    private boolean active;

    @NotNull
    @Column(name = "report_id")
    private String reportId;
}

The ReportTypeService.java contains:

public Page<ReportType> findAll(Pageable pageable) {
   return reportTypeRepository.findAll(pageable);
}

The error I got is

service.ReportTypeService.findAll() with cause = 'NULL' and exception = 'No property report found for type ReportType! Did you mean 'reportId'?'

org.springframework.data.mapping.PropertyReferenceException: No property report found for type ReportType! Did you mean 'reportId'?

From the error message my understanding is Spring boot is looking for field report but it doesn't exist, but I didn't pass anything except pageable, can anyone help on this?

Haifeng Zhang
  • 30,077
  • 19
  • 81
  • 125
  • Try by writing your own and check whether it is working. – GnanaJeyam Feb 06 '20 at 18:11
  • 1
    I think the problem can be found in the `sort` of the `pageable`. Are you doing something like `PageRequest.of(0, 10, Sort.by("report")` ? – Dirk Deyne Feb 06 '20 at 19:04
  • @DirkDeyne Thanks for your reply. I just configured page number and page size, I didn't pass any sort request option – Haifeng Zhang Feb 06 '20 at 19:14
  • sure? I tested it and got basically an identical error-messages `org.springframework.data.mapping.PropertyReferenceException: No property report found for type ReportType! Did you mean 'reportId'?` – Dirk Deyne Feb 06 '20 at 19:31
  • Is there anything in the class reportTypeRepository which overrides the default? – Assafs Feb 09 '20 at 16:57

0 Answers0