如何比较spring数据jpa @Query中的属性

时间:2018-04-16 06:02:51

标签: java spring-data-jpa

我尝试比较属性,但它是类和查询

@Query("select a from ApplyOfIP as a left join a.state where a.state = :state")

它将比较state.id,但我想比较州的属性

 @Query("select a from ApplyOfIP as a left join a.state where a.state = :state " +
        "and a.applicant.department like %:department% " +
        "and (a.finallyIPName like %:ipName% or a.applyInfo.applyIPName like %:ipName%) " +
        "and a.applicant.name like %:applicantName%")
Page<ApplyOfIP> findApplyOfIPSWithState(
        @Param("page") Pageable pageable, @Param("state") State state
        , @Param("department") String department, @Param("ipName") String ipName
        , @Param("applicantName") String applicantName);

0 个答案:

没有答案