package com.eshore.gringotts.web.domain.repository;

import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
import com.eshore.gringotts.web.domain.entity.Authentication;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.stereotype.Repository;

/**
 * @author lanyuanxiaoyao
 * @date 2024-12-02
 */
@SuppressWarnings("NullableProblems")
@Repository
public interface AuthenticationRepository extends SimpleRepository<Authentication, Long> {
    @Override
    @EntityGraph(value = "authentication.list", type = EntityGraph.EntityGraphType.FETCH)
    List<Authentication> findAll(Specification<Authentication> specification);

    @Override
    @EntityGraph(value = "authentication.list", type = EntityGraph.EntityGraphType.FETCH)
    List<Authentication> findAll(Specification<Authentication> specification, Sort sort);

    @Override
    @EntityGraph(value = "authentication.detail", type = EntityGraph.EntityGraphType.FETCH)
    Optional<Authentication> findOne(Specification<Authentication> specification);
}
