package dev.fyloz.trial.colorrecipesexplorer.repository

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

@Repository
interface MaterialTypeRepository : NamedJpaRepository<MaterialType> {
    /** Checks if a material type exists with the given [prefix]. */
    fun existsByPrefix(prefix: String): Boolean

    /** Gets all material types which are not system types. */
    fun findAllBySystemTypeIs(value: Boolean): Collection<MaterialType>

    /** Gets the material type with the given [prefix]. */
    fun findByPrefix(prefix: String): MaterialType?
}
