<commit_before>package org.hibernate.test.jpa.repository;

import org.hibernate.test.domain.Event;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.QueryHints;
import org.springframework.stereotype.Repository;

import javax.persistence.QueryHint;
import java.util.List;

/**
 * org.hibernate.test.jpa.repository.AccountRepository
 *
 * @author 배성혁 <EMAIL>
 * @since 2013. 12. 21. 오후 5:59
 */
@Repository
public interface EventRepository extends JpaRepository<Event, Long> {

    @Query("select evt from Event evt where evt.title=:title")
    @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value = "true") })
    List<Event> findByTitle(final String title);
}<commit_msg>-. bug fix in sample repository class<commit_after>package org.hibernate.test.jpa.repository;

import org.hibernate.test.domain.Event;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.QueryHints;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.persistence.QueryHint;
import java.util.Date;
import java.util.List;

/**
 * org.hibernate.test.jpa.repository.AccountRepository
 *
 * @author 배성혁 <EMAIL>
 * @since 2013. 12. 21. 오후 5:59
 */
@Repository
public interface EventRepository extends JpaRepository<Event, Long> {

    // NOTE: JPQL 결과 셋을 2nd level cache 에 저장하기 위해 @QueryHints 를 사용합니다.
    @Query("select evt from Event evt where evt.title=:title")
    @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value = "true") })
    List<Event> findByTitle(@Param("title") final String title);

    // NOTE: 일반 쿼리 결과도 @QueryHints를 이용해 2nd level cache에 저장합니다.
    @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value = "true") })
    List<Event> findByDate(Date date);
}
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.012195121951219513, 'mean_word_length': 5.003048780487805, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '2280951', 'n_tokens_mistral': 683, 'n_tokens_neox': 661, 'n_words': 140}