Public
Authored by 邓怡键

Spring Data Jpa在用的经典HQL类

注意:

  • 同时使用Spring Data Jpa和MyBatis的情况下注意@Param注解的包导入正确。

  • HQL中默认的表名为Entity类名。如果要使用原生SQL语句,请变为下面的写法:

@Query(value = "SELECT * from user_info WHERE user_id = :userId", nativeQuery = true)

UserInfoRepository.java 580 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment