The CrudRepository interface

We can extend CrudRepository to expose all create, read, update, and delete methods on an entity. The following snippet shows TodoRepository extending CrudRepository:

    public interface TodoRepository extends CrudRepository<Todo, Long>
{
}

TodoRepository can be used to perform all methods exposed by the CrudRepository interface. Let's write a few unit tests to test some of these methods.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset