Package com.proyecto.jpa.repository
Interface CustomerRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Customer,,Long> org.springframework.data.jpa.repository.JpaRepository<Customer,,Long> org.springframework.data.repository.ListCrudRepository<Customer,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<Customer,,Long> org.springframework.data.repository.PagingAndSortingRepository<Customer,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<Customer>,org.springframework.data.repository.Repository<Customer,Long>
@Repository
public interface CustomerRepository
extends org.springframework.data.jpa.repository.JpaRepository<Customer,Long>
Repositorio JPA para la entidad Customer.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanexistsByEmail(String email) Verifica si existe un cliente con el email dado.findByEmail(String email) Busca un cliente por su email.findByFirstNameContainingOrLastNameContaining(String firstName, String lastName) Busca clientes cuyo nombre o apellido contenga el texto dado.findByStatus(Customer.CustomerStatus status) Busca clientes por estado.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByEmail
Busca un cliente por su email.- Parameters:
email- email del cliente- Returns:
- Optional con el cliente si existe
-
findByStatus
Busca clientes por estado.- Parameters:
status- estado del cliente- Returns:
- lista de clientes con ese estado
-
findByFirstNameContainingOrLastNameContaining
Busca clientes cuyo nombre o apellido contenga el texto dado.- Parameters:
firstName- texto a buscar en el nombrelastName- texto a buscar en el apellido- Returns:
- lista de clientes que coinciden
-
existsByEmail
Verifica si existe un cliente con el email dado.- Parameters:
email- email a verificar- Returns:
- true si existe, false en caso contrario
-