<commit_before>package com.demo.app.repository;

import java.io.Serializable;
import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;

import com.demo.app.domain.Entity;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.query.SqlPredicate;

public class EntityHzRepository<T extends Entity, K extends Serializable>  {

	@Autowired(required = false)
	private HazelcastInstance instance;

	@SuppressWarnings({ "unchecked", "rawtypes" })
	protected Iterable<T> getEntitiesFiltered(Class<? extends Entity> clazz, String condition){
		return new ArrayList(instance.getMap(clazz.getSimpleName()).values(new SqlPredicate(condition)));
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	protected T getEntityFiltered(Class<? extends Entity> clazz, String condition){
		Iterable<T> elements = new ArrayList(instance.getMap(clazz.getSimpleName()).values(new SqlPredicate(condition)));<commit_msg>Transactional<commit_after>package com.demo.app.repository;

import java.io.Serializable;
import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;

import com.demo.app.domain.Entity;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.query.SqlPredicate;

public class EntityHzRepository<T extends Entity, K extends Serializable>  {

	@Autowired(required = false)
	private HazelcastInstance instance;

	@SuppressWarnings({ "unchecked", "rawtypes" })
	protected Iterable<T> getEntitiesFiltered(Class<? extends Entity> clazz, String condition){
		Iterable<T> iterable = new ArrayList(instance.getMap(clazz.getSimpleName()).values(new SqlPredicate(condition)));
		return !iterable.iterator().hasNext() ? null : iterable;
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	protected T getEntityFiltered(Class<? extends Entity> clazz, String condition){
		Iterable<T> elements = new ArrayList(instance.getMap(clazz.getSimpleName()).values(new SqlPredicate(condition)));
{'fraction_non_alphanumeric': 0.11815856777493607, 'fraction_numerical': 0.0, 'mean_word_length': 7.394849785407725, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '830736', 'n_tokens_mistral': 576, 'n_tokens_neox': 582, 'n_words': 120}