<commit_before>package org.openregistry.core.repository.jpa;

import org.openregistry.core.repository.ReferenceRepository;
import org.openregistry.core.domain.*;
import org.openregistry.core.domain.jpa.*;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.PersistenceContext;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.List;

/**
 * Default implementation of temporary repository. 
 */
@Repository
public final class JpaReferenceRepository implements ReferenceRepository {

    @PersistenceContext
    private EntityManager entityManager;

    @Transactional
    public List<Person> getPeople() {
        return (List<Person>) this.entityManager.createQuery("select p from person p order by p.preferredName.family, p.preferredName.given").getResultList();
    }

    @Transactional
    public Person getPersonById(final Long id) {
        return (Person) this.entityManager.find(JpaPersonImpl.class, id);
    }

    @Transactional
    public List<Department> getDepartments() {
        return (List<Department>) this.entityManager.createQuery("select d from department d order by d.name").getResultList(); 
    }

    @Transactional
    public Department getDepartmentById(final Long id) {
        return this.entityManager.find(JpaDepartmentImpl.class, id);
    }

    @Transactional
    public List<Campus> getCampuses() {
        return (List<Campus>) this.entityManager.createQuery("select c from campus c order by c.name").getResultList();
    }

    @Transactional
    public Campus getCampusById(final Long id) {
        return this.entityManager.find(JpaCampusImpl.class, id);<commit_msg>NOJIRA add Name Reconciliation<commit_after>package org.openregistry.core.repository.jpa;

import org.openregistry.core.repository.ReferenceRepository;
import org.openregistry.core.domain.*;
import org.openregistry.core.domain.jpa.*;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.PersistenceContext;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.List;

/**
 * Default implementation of temporary repository. 
 */
@Repository
public final class JpaReferenceRepository implements ReferenceRepository {

    @PersistenceContext
    private EntityManager entityManager;

    @Transactional
    public List<Person> getPeople() {
        return (List<Person>) this.entityManager.createQuery("select p from person p order by p.preferredName.family, p.preferredName.given").getResultList();
    }

    @Transactional
    public Person getPersonById(final Long id) {
        return (Person) this.entityManager.find(JpaPersonImpl.class, id);
    }

    @Transactional
    public List<OrganizationalUnit> getOrganizationalUnits() {
        return (List<OrganizationalUnit>) this.entityManager.createQuery("select d from organizational_unit d order by d.name").getResultList(); 
    }

    @Transactional
    public OrganizationalUnit getOrganizationalUnitById(final Long id) {
        return this.entityManager.find(JpaOrganizationalUnitImpl.class, id);
    }

    @Transactional
    public List<Campus> getCampuses() {
        return (List<Campus>) this.entityManager.createQuery("select c from campus c order by c.name").getResultList();
    }

    @Transactional
    public Campus getCampusById(final Long id) {
        return this.entityManager.find(JpaCampusImpl.class, id);
{'fraction_non_alphanumeric': 0.09327303561334087, 'fraction_numerical': 0.0, 'mean_word_length': 4.5296875, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '5665784', 'n_tokens_mistral': 960, 'n_tokens_neox': 938, 'n_words': 216}