Spring Data JPA repository methods don't recognize property names with underscores

前端 未结 3 1154
忘掉有多难
忘掉有多难 2020-12-11 16:18

I have underscores in the entity property names, and when Spring tries to create the JPA repository implementation, it results in an exception trying to resolve the name of

3条回答
  •  隐瞒了意图╮
    2020-12-11 17:04

    If you cant change the entities which was my case then better use jqpl query or native sql query on top of repository method

    @Query("select s from Student s where s.s_name=?")
    List findBySName();
    

提交回复
热议问题