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

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

@SuppressWarnings("NullableProblems")
@Repository
public interface DataResourceRepository extends SimpleRepository<DataResource, Long> {
    @Override
    @EntityGraph(value = "data_resource.list", type = EntityGraph.EntityGraphType.FETCH)
    List<DataResource> findAll();

    @Override
    @EntityGraph(value = "data_resource.detail", type = EntityGraph.EntityGraphType.FETCH)
    Optional<DataResource> findById(Long id);
}
