package org.example.seed.repository;

import org.example.seed.entity.ChefEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * Created by PINA on 25/06/2017.
 */
@Repository
public interface ChefRepository extends JpaRepository<ChefEntity, String> {
}

@@ -136,16 +136,70 @@
 sitory;%0A
+import org.springframework.data.jpa.repository.Query;%0A
 import o
@@ -370,11 +370,192 @@
 tring%3E %7B
+%0A%0A    @Query(%22SELECT ce FROM ChefEntity ce LEFT JOIN ce.account AS ae JOIN ce.dishes AS se WHERE ce.active = TRUE AND se.id = ?1%22)%0A    ChefEntity findOneByDish(final String idDish);
 %0A%7D%0A

create custom method to find chef by dish id