Unable to locate appropriate constructor error for nested list object in kotlin and JpaRepository

后端 未结 3 1716
刺人心
刺人心 2021-01-25 15:10

I\'m facing the following error when JPA attempts to map the result from a query to the result repository method DTO:

org.hibernate.hql.internal.ast.QuerySyntaxE         


        
3条回答
  •  一生所求
    2021-01-25 15:48

    Why does your JdbcUserRepository returns a User object for findUserByUsername and not a DbUser? The solution should be obvious:

    override fun findUserByUsername(username: String): DbUser?
    

    And you do the mapping afterwards manually.

    You should think that people know why they introduced multiple representations of the same object instead of using a single representation as long as possible...

提交回复
热议问题