博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于spring data jpa的@query的传入参数是对象怎么匹配参数
阅读量:5951 次
发布时间:2019-06-19

本文共 855 字,大约阅读时间需要 2 分钟。

 

 

/** * Specifies methods used to obtain and modify person related information * which is stored in the database. * @author Petri Kainulainen */public interface PersonRepository extends JpaRepository
{ /** * Finds a person by using the last name as a search criteria. * @param lastName * @return A list of persons whose last name is an exact match with the given last name. * If no persons is found, this method returns an empty list. */ @Query("SELECT p FROM Person p WHERE LOWER(p.lastName) = LOWER(:lastName)") public List
find(@Param("lastName") String lastName);}

 

 

 

@Query("update HsAlbum album set album.albumName = #{#hsAlbum.albumName} ,album.description = #{#hsAlbum.description } ")public int update(HsAlbum hsAlbum);

 

转载于:https://www.cnblogs.com/nongzihong/p/10882427.html

你可能感兴趣的文章