我想使用springboot jpa实现下面的查询,有可能吗?
select * from
Claims.misuser.CLXMstApplicationRole AR WITH (NOLOCK) INNER JOIN
PADB.misuser.clxmstaccesspermission AP WITH (NOLOCK) ON
AP.intApplicationRoleId = AR.intApplicationRoleId
where AR.txtApplicationRoleCode = 'CRUAPP'
我在我的存储库界面中编写了以下代码
@Query(value=QueryConstants.InnerJoin_AppRole_AccessPermission)
List<ApplicationRole> findBy_InnerJoin_AppRole_AccessPermission();
QueryConstants.java
InnerJoin_AppRole_AccessPermission="select AR FROM com.infosys.claims.broadband.springboot.entity.claims.ApplicationRole AR "+
"INNER JOIN com.infosys.claims.broadband.springboot.entity.padb.AccessPermission AP"+
"ON AR.applicationRole = AP.applicationRoleId" +
"where AR.applicationRoleCode = 'CRUAPP' ";
但这给了我空列表,在 mssql 中,它给了我记录。