package com.astalange.core.repository;

import com.astalange.core.entity.Educateur;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.springframework.data.jpa.repository.Query;
import java.util.List;

@Repository
public interface EducateurRepository extends JpaRepository<Educateur, Long> {

    @Query("SELECT e FROM Educateur e LEFT JOIN FETCH e.categorie LEFT JOIN FETCH e.equipe")
    List<Educateur> findAllWithCategorieAndEquipe();
}
