spring data jpa写update

xiaoxiao2021-02-28  5

@Modifying @Transactional @Query("update AddressEntity addr set addr.defaulted = false where addr.user.userID = :userID" + " and addr.id <> :id") void setOtherAddressNotDefault(@Param("userID")Long userID, @Param("id")Long id);

其中,@Modifying和@Transactional必须有

转载请注明原文地址: https://www.6miu.com/read-1150313.html

最新回复(0)