Interface TodoRepository
- All Superinterfaces:
- org.springframework.data.repository.CrudRepository<Todo,,- Long> - org.springframework.data.repository.Repository<Todo,- Long> 
@Repository
public interface TodoRepository
extends org.springframework.data.repository.CrudRepository<Todo,Long> 
The TodoRepository is a repository for Todo entities.
- 
Method SummaryModifier and TypeMethodDescriptionfindAllByUserId(Long user_id) This method returns all Todo entities with a given user_id.findByIdAndUser(long id, User user) This method returns a Todo entity with a given id and user.Methods inherited from interface org.springframework.data.repository.CrudRepositorycount, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
- 
Method Details- 
findByIdAndUserThis method returns a Todo entity with a given id and user.- Parameters:
- id- id of the todo
- user- user of the todo
- Returns:
- Optional of Todo (empty if not found)
 
- 
findAllByUserIdThis method returns all Todo entities with a given user_id.- Parameters:
- user_id- id of the user
- Returns:
- all Todo entities with a given user_id
 
 
-