首页 > 技术文章 > 工作中遇到的问题--JPA 一对多查询

ly-radiata 2015-09-14 15:57 原文

/**
     *  order by gs.updateDate desc     
     *  SELECT gs FROM GoodStatus gs WHERE gs IN(
     * @param goodId
     * @return
     */
    @Query("SELECT gs FROM Good g left join g.goodStatus as gs where g.id = :goodId order by gs.updateDate desc ")
    public Set<GoodStatus> fingByGoodId(@Param("goodId")Long goodId);
   

推荐阅读