package com.exadel.repository; import com.exadel.model.entity.user.User; import com.exadel.model.entity.user.UserRole; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Optional; @Transactional public interface UserRepository extends JpaRepository<User, Long> { Page<User> findAll(Pageable pageable); Optional<User> findOneByEmail(String email); List<User> findByRole(UserRole role); List<User> findByRoleNot(UserRole role); }