<commit_before>package florian_haas.lucas.business;

import static florian_haas.lucas.security.EnumPermission.ENTITY_EXISTS;

import javax.ejb.*;
import javax.persistence.*;
import javax.validation.executable.*;

import florian_haas.lucas.model.EntityBase;
import florian_haas.lucas.security.*;

@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
@ValidateOnExecution(type = ExecutableType.IMPLICIT)
@Secured
public class EntityBean implements EntityBeanLocal {

	@PersistenceContext
	private EntityManager manager;

	@Override
	@RequiresPermissions(ENTITY_EXISTS)
	public Boolean exists(Long id, Class<? extends EntityBase> entityClass) {
		return manager.createQuery("SELECT COUNT(e.id) FROM " + entityClass.getSimpleName() + " e WHERE e.id=:id", Long.class).getSingleResult() > 0;
	}

}<commit_msg>Fixed an error with the query<commit_after>package florian_haas.lucas.business;

import static florian_haas.lucas.security.EnumPermission.ENTITY_EXISTS;

import javax.ejb.*;
import javax.persistence.*;
import javax.validation.executable.*;

import florian_haas.lucas.model.EntityBase;
import florian_haas.lucas.security.*;

@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
@ValidateOnExecution(type = ExecutableType.IMPLICIT)
@Secured
public class EntityBean implements EntityBeanLocal {

	@PersistenceContext
	private EntityManager manager;

	@Override
	@RequiresPermissions(ENTITY_EXISTS)
	public Boolean exists(Long id, Class<? extends EntityBase> entityClass) {
		return manager.createQuery("SELECT COUNT(e.id) FROM " + entityClass.getSimpleName() + " e WHERE e.id=" + id, Long.class)
				.getSingleResult() > 0;
	}

}
{'fraction_non_alphanumeric': 0.10197960407918416, 'fraction_numerical': 0.0011997600479904018, 'mean_word_length': 6.830985915492958, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4626316', 'n_tokens_mistral': 538, 'n_tokens_neox': 515, 'n_words': 105}