Fight With Me!!!

导航

spring data jpa删除的使用方式

public interface UserRepository extends CrudRepository<User, Long> {

  Long deleteByLastname(String lastname);

  List<User> removeByLastname(String lastname);

}

Derivation of delete queries using given method name is supported starting with version 1.6.0.RC1 of Spring Data JPA. The keywords remove and delete are supported. As return value one can choose between the number or a list of removed entities.

posted on 2017-06-05 21:56  nickTimer  阅读(1588)  评论(0编辑  收藏  举报