0

I'm trying to automatically create a Spring Data method based on name which would do

delete from USER_ROLES_T where identifier = :identifier and roleId in (:roleIds)

If I didn't have the IN, it would be straightforward -- this is working:

void deleteByIdentifierAndRoleId(String identifier, long roleId);

But how to wire the IN into the name without going through annotations?

gene b.
  • 10,512
  • 21
  • 115
  • 227
  • 3
    https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repository-query-keywords: `deleteByIdentifierAndRoleIdIn`. – sp00m Jun 11 '19 at 15:44
  • 2
    Possible duplicate of [Spring CrudRepository findByInventoryIds(List inventoryIdList) - equivalent to IN clause](https://stackoverflow.com/questions/18987292/spring-crudrepository-findbyinventoryidslistlong-inventoryidlist-equivalen) – sp00m Jun 11 '19 at 15:45

1 Answers1

1

Try this one void deleteByIdentifierAndRoleIdIn(String identifier, long roleId);

It would helpful to you.

Sana
  • 360
  • 3
  • 13