package dev.fyloz.trial.colorrecipesexplorer.repository

import dev.fyloz.trial.colorrecipesexplorer.model.Material
import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType
import org.springframework.stereotype.Repository

@Repository
interface MaterialRepository : NamedJpaRepository<Material> {
    /** Checks if one or more materials have the given [materialType]. */
    fun existsByMaterialType(materialType: MaterialType): Boolean

    /** Gets all the materials with the given [materialType]. */
    fun findAllByMaterialType(materialType: MaterialType): Collection<Material>
}
