Spring DATA JPA 中findAll 进行OrderBy报错

原文链接:http://blog.csdn.net/remote_roamer/article/details/51460869

需要在 repository 中 定义这样的方法 :findAllByOrderByUpdatedAtDesc()

public List findAllByOrderByUpdatedAtDesc();

重要:(中间要多加一个By)

findAllByOrderByUpdatedAtDesc();

The little ‘By’ does all the magic.

猜你喜欢

转载自blog.csdn.net/weixin_34214500/article/details/87105632