<commit_before>package at.medunigraz.imi.reassess.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaQuery;

import at.medunigraz.imi.reassess.model.NoteEvent;

public class NoteEventDAO {

	private EntityManager em;

	public NoteEventDAO() {
		em = DAOFactory.getInstance().getEntityManager();
	}

	public NoteEvent get(Integer id) {
		NoteEvent note = em.find(NoteEvent.class, id);
		return note;
	}

	public List<NoteEvent> list(int first, int max) {
		CriteriaQuery<NoteEvent> criteria = em.getCriteriaBuilder().createQuery(NoteEvent.class);
		criteria.select(criteria.from(NoteEvent.class));
		return em.createQuery(criteria).setFirstResult(first).setMaxResults(max).getResultList();
	}
}
<commit_msg>Adds nice documentation before we forget<commit_after>package at.medunigraz.imi.reassess.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaQuery;

import at.medunigraz.imi.reassess.model.NoteEvent;

public class NoteEventDAO {

	private EntityManager em;

	public NoteEventDAO() {
		em = DAOFactory.getInstance().getEntityManager();
	}

	public NoteEvent get(Integer id) {
		NoteEvent note = em.find(NoteEvent.class, id);
		return note;
	}

	/**
	 * Gets a paginated list of notes.
	 * 
	 * @param first
	 *            First result.
	 * @param max
	 *            Maximum number of results
	 * @return List of notes.
	 */
	public List<NoteEvent> list(int first, int max) {
		CriteriaQuery<NoteEvent> criteria = em.getCriteriaBuilder().createQuery(NoteEvent.class);
		criteria.select(criteria.from(NoteEvent.class));
		return em.createQuery(criteria).setFirstResult(first).setMaxResults(max).getResultList();
	}
}

{'fraction_non_alphanumeric': 0.11372774267662263, 'fraction_numerical': 0.0, 'mean_word_length': 4.806666666666667, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6015854', 'n_tokens_mistral': 575, 'n_tokens_neox': 550, 'n_words': 109}