package com.jakubu9333.grammarManager.dao;

import com.jakubu9333.grammarManager.model.RuleModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author Jakub Uhlarik
 */
@Repository
public interface RuleRepository extends JpaRepository<RuleModel, Long> {

    List<RuleModel> findByLeftSymbol(String leftSide);

    Optional<RuleModel> findByIdAndGrammar_Id(Long id, Long grammarId);

    List<RuleModel> findByLeftSymbolAndGrammar_Id(String leftSide, Long GrammarId);
}
