Which of the following is true about the deleteById method of a JpaRepository?

  • It deletes all records in the repository.
  • It deletes a record with the specified primary key value.
  • It only marks a record for deletion but does not physically remove it from the database.
  • It updates a record with the specified primary key value to mark it as deleted.
The deleteById method of a JpaRepository deletes a record with the specified primary key value. It performs a physical deletion of the record from the database. It is a straightforward way to delete a specific record from the repository. The other options do not accurately describe the behavior of this method.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *