package dev.dinauer.maven.maven.core.snapshot;

import dev.dinauer.maven.maven.core.ArtifactId;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import jakarta.enterprise.context.ApplicationScoped;

import java.util.Map;

@ApplicationScoped
public class SnapshotVersionRepo implements PanacheRepositoryBase<SnapshotVersion, String>
{
    public SnapshotVersion findByArtifactAndVersion(ArtifactId artifactId, String version)
    {
        return find("artifact = :artifact AND version = :version", Map.ofEntries(Map.entry("artifact", artifactId), Map.entry("version", version))).firstResult();
    }
}
