I am trying to create a custom deleteBy method query in my repository. It seems that instead of deleting, hibernate is making a select statement.
public interface ContactRepository extends JpaRepository<Contact, Integer> {
Integer deleteByEmailAddress(String emailAddress);
//and this one works
Contact findContactByName(String name);
}
and here is what Hibernate is trying to do:
Hibernate: select contact0_.id as id1_2_, contact0_.emailAddress as >emailAdd2_2_, contact0_.name as name3_2_ from Contact contact0_ where >contact0_.emailAddress=?
What am I missing? Do I have to make a special configuration in order to make delete work?