package org.codiki.core.repositories;

import java.util.List;

import org.codiki.core.entities.persistence.Category;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CategoryRepository extends CrudRepository<Category, Long> {
	@Query("SELECT c FROM Category c JOIN FETCH c.listSubCategories")
	List<Category> findAllWithSubCategories();
}
