<commit_before>package com.buchner.auction.model.core.database;

import com.buchner.auction.model.core.entity.AuctionResult;
import com.buchner.auction.model.core.entity.AuctionType;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import java.util.List;
import java.util.stream.Collectors;

@RequestScoped
public class AuctionResultDao {

    @Inject
    private EntityManager entityManager;

    protected AuctionResultDao() {

    }

    public void save(AuctionResult auctionResult) {

        entityManager.persist(auctionResult);
    }

    @SuppressWarnings("JpaQlInspection")
    public List<AuctionResult> findAuctionResultsByType(AuctionType auctionType) {

        TypedQuery<AuctionResult> query = entityManager
            .createQuery("select ar from AuctionResult ar",
                AuctionResult.class);
        List<AuctionResult> resultList = query.getResultList();
        return resultList.stream().filter(a -> a.getAuctionType().ordinal() == auctionType.ordinal()).collect(
            Collectors.toList());
    }
}<commit_msg>- Fixed type error in auction result table when quering with enum types<commit_after>package com.buchner.auction.model.core.database;

import com.buchner.auction.model.core.entity.AuctionResult;
import com.buchner.auction.model.core.entity.AuctionType;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import java.util.List;

@RequestScoped
public class AuctionResultDao {

    @Inject
    private EntityManager entityManager;

    protected AuctionResultDao() {

    }

    public void save(AuctionResult auctionResult) {

        entityManager.persist(auctionResult);
    }

    @SuppressWarnings("JpaQlInspection")
    public List<AuctionResult> findAuctionResultsByType(AuctionType auctionType) {

        TypedQuery<AuctionResult> query = entityManager
            .createQuery("select ar from AuctionResult ar where ar.auctionType = :auctionType",
                AuctionResult.class);
        query.setParameter("auctionType", auctionType);
        return query.getResultList();
    }
}
{'fraction_non_alphanumeric': 0.09240337627721013, 'fraction_numerical': 0.0, 'mean_word_length': 4.095022624434389, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6722872', 'n_tokens_mistral': 644, 'n_tokens_neox': 648, 'n_words': 119}