package dev.dinauer.maven.jpa.maven.repo;

import dev.dinauer.maven.jpa.maven.GroupId;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import io.quarkus.panache.common.Parameters;
import jakarta.enterprise.context.ApplicationScoped;

import java.util.Optional;

@ApplicationScoped
public class GroupRepo implements PanacheRepositoryBase<GroupId, String>
{
    public Optional<GroupId> findOptionalByGroupId(String groupId)
    {
        return find("groupId = :groupId", Parameters.with("groupId", groupId)).firstResultOptional();
    }
}
