【发布时间】:2015-09-29 12:47:03
【问题描述】:
我正在尝试在我的存储库中创建自定义 deleteBy 方法查询。 似乎hibernate不是在删除,而是在做一个select语句。
public interface ContactRepository extends JpaRepository<Contact, Integer> {
Integer deleteByEmailAddress(String emailAddress);
//and this one works
Contact findContactByName(String name);
}
这就是 Hibernate 正在尝试做的事情:
休眠:选择contact0_.id 作为id1_2_,contact0_.emailAddress 作为>emailAdd2_2_,contact0_.name 作为name3_2_ from Contact contact0_ where >contact0_.emailAddress=?
我错过了什么?我是否必须进行特殊配置才能使删除工作?
【问题讨论】:
标签: java spring hibernate jpa spring-data-jpa