Skip to content
Advertisement

Tag: crud-repository

Delete from a JPARepository with an EmbeddedId by a field in the primary key

Currently I have a Spring Boot application using JpaRepository<Employee, EmployeePk> where let’s say EmployeePk is firstname, lastname. Is there a way to delete by Primary Key field without having to specify a custom @Query? It’s ok to delete multiple rows if multiple people were named “John”. Example: such as Employee class and Embedded PK Answer Thanks for adding the Employee

Advertisement