Interface DataStudentRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<StudentEntity,
,Long> org.springframework.data.repository.PagingAndSortingRepository<StudentEntity,
,Long> org.springframework.data.repository.Repository<StudentEntity,
Long>
@Repository
public interface DataStudentRepository
extends org.springframework.data.repository.CrudRepository<StudentEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<StudentEntity,Long>
JPA repository for managing
StudentEntity
entities in the database. Extends JpaRepository
and PagingAndSortingRepository
to provide
CRUD operations and pagination.-
Method Summary
Modifier and TypeMethodDescriptionboolean
existsByEmailAndPhoneAndOrganization_IdAndIdIsNot
(String email, String phone, Long organizationId, Long userId) Checks whether a student with the specified phone and email that belongs to certain organization exists.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll, findAll
-
Method Details
-
existsByEmailAndPhoneAndOrganization_IdAndIdIsNot
boolean existsByEmailAndPhoneAndOrganization_IdAndIdIsNot(String email, String phone, Long organizationId, Long userId) Checks whether a student with the specified phone and email that belongs to certain organization exists.- Parameters:
email
- the email of the studentphone
- the phone of the studentorganizationId
- the unique identifier of the organizationuserId
- the unique identifier of the user- Returns:
true
if a student with this email and phone in this organization exists. Otherwisefalse
-