Interface CustomerRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Customer,String>, org.springframework.data.repository.ListCrudRepository<Customer,String>, org.springframework.data.repository.ListPagingAndSortingRepository<Customer,String>, org.springframework.data.mongodb.repository.MongoRepository<Customer,String>, org.springframework.data.repository.PagingAndSortingRepository<Customer,String>, org.springframework.data.repository.query.QueryByExampleExecutor<Customer>, org.springframework.data.repository.Repository<Customer,String>

@Repository public interface CustomerRepository extends org.springframework.data.mongodb.repository.MongoRepository<Customer,String>
Repository interface for Customer entities, providing CRUD operations and custom query methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves a customer by their email address.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.mongodb.repository.MongoRepository

    findAll, findAll, insert, insert

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByEmail

      Optional<Customer> findByEmail(String email)
      Retrieves a customer by their email address.
      Parameters:
      email - email to search for.
      Returns:
      Optional containing the Customer, or an empty Optional otherwise.