我正在使用Spring mongo数据,并且没有任何原因出现很多此类错误。服务器启动后,三十分钟后开始引发这些错误。
该实体包含显然找不到的属性:
org.springframework.data.mapping.context.InvalidPersistentPropertyPath: No property 'status' found on class com.parozlabs.tx.api.books.Book! Did you mean: status?
实体:
@Document(collection = "books")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Book implements Resource {
@Id
private ObjectId id;
private long created;
private long startDate;
private BookStatus status;
<getters and setters>
...
}
存储库
public interface BooksRepositoryCustom extends
PagingAndSortingRepository<Book, String> {
// Get all books, for admins
List<Book> findByStatus(BookStatus statuss);
}