Announcement Announcement Module
No announcement yet.
spring data jpa could do shis?a simple search Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring data jpa could do shis?a simple search

    i have a project using spring data jpa .now i have a bussiness: i will find all data from table order by some filed,i user jpa Specification ,but failure.

    code as :
    @Table(name = "GSOFT_USER")
    public class GsoftUser implements {

    private static final long serialVersionUID = -8681507674322020665L;

    @GenericGenerator(name = "generator", strategy = "assigned")
    @GeneratedValue(generator = "generator")
    * 主键
    private String uuid;
    @NotEmpty(message = "请输入登录名")
    private String loginName;

    private String authType;

    private String token;

    private long tryMax;

    private String pwd;

    private int orderNum;

    private boolean enabled = true;

    private boolean sys;

    private String depId;

    private String deptName;

    dao interface:
    public interface UserPersistence extends jpaRepository<GsoftUser, String>{
    public List<GsoftUser> findByOrderByOrderNumDesc(Pageable pageable);
    This interface ,i want find All data only sort by OrderNum field. when i run junit test,it throws Null point error, why?
    i use spring data jpa,i could not track the daoImpl code, i do not know how spring data jpa reflect the interface name to search sentence? i feel this simple function cost my more time using spring data jpa.

    who can help me?