Tôi gặp vấn đề lạ đối với kho lưu trữ dữ liệu xuân mongodb .. Tôi muốn loại trừ một trường khỏi yêu cầu findAll
của mình. Làm thế nào tôi có thể đạt được điều này ?Dữ liệu mùa xuân Mongodb kho findAll loại trừ trường
này hoạt động hoàn hảo:
@Query(fields = "{'objectContentAsJson':0}")
Page<ObjectHistory> findByObjectIdAndServiceIgnoreCase(String objectId, String service, Pageable pageable);
Nhưng không có cơ hội cho findAll
:
@Query(fields = "{'objectContentAsJson':0}")
Page<ObjectHistory> findAll(Pageable pageable);
này ném:
Nguyên nhân: org.springframework.data.mapping.PropertyReferenceException : No Tìm bất động sảnTìm thấy loại Obje ctHistory! tại org.springframework.data.mapping.PropertyPath. (PropertyPath.java:75) tại org.springframework.data.mapping.PropertyPath.create (PropertyPath.java:327) tại org.springframework.data.mapping .PropertyPath.create (PropertyPath.java:307) tại org.springframework.data.mapping.PropertyPath.from (PropertyPath.java:270) tại org.springframework.data.mapping.PropertyPath.from (PropertyPath.java : 241) tại org.springframework.data.repository.query.parser.Part (Part.java:76)
Nhưng tôi không nhận được nó, nó hoạt động như tôi ở chức năng khác –
Thanks for the help anyway! –
Trong trường hợp khác, truy vấn có thể phát sinh từ tên phương thức. –