尽量使用session.createQuery(“Hql”).setParameter来删除
拼凑的HQL在某些时刻可能会失效。
删除之后session.flush
delete Favorite f where f.pet.id=:PetId and f.user.id=:UserId
有些时候hibernate 处理 字表的映射ID时候需要将int转换为Long型
拼凑的HQL在某些时刻可能会失效。
删除之后session.flush
delete Favorite f where f.pet.id=:PetId and f.user.id=:UserId
有些时候hibernate 处理 字表的映射ID时候需要将int转换为Long型