<commit_before>package net.openl10n.flies.dao;

import java.util.List;

import net.openl10n.flies.common.LocaleId;
import net.openl10n.flies.model.HLocale;

import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Name("supportedLanguageDAO")
@AutoCreate
@Scope(ScopeType.STATELESS)
public class LocaleDAO extends AbstractDAOImpl<HLocale, Long>
{

   public LocaleDAO()
   {
      super(HLocale.class);
   }

   public LocaleDAO(Session session)
   {
      super(HLocale.class, session);
   }

   public HLocale findByLocaleId(LocaleId locale)
   {
      return (HLocale) getSession().createCriteria(HLocale.class).add(Restrictions.naturalId().set("localeId", locale)).setCacheable(true).uniqueResult();
   }

   public List<HLocale> findAllActive()
   {
      return findByCriteria(Restrictions.eq("active", true));
   }

}<commit_msg>finished renaming supportedLanguageDAO component to localeDAO...<commit_after>package net.openl10n.flies.dao;

import java.util.List;

import net.openl10n.flies.common.LocaleId;
import net.openl10n.flies.model.HLocale;

import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Name("localeDAO")
@AutoCreate
@Scope(ScopeType.STATELESS)
public class LocaleDAO extends AbstractDAOImpl<HLocale, Long>
{

   public LocaleDAO()
   {
      super(HLocale.class);
   }

   public LocaleDAO(Session session)
   {
      super(HLocale.class, session);
   }

   public HLocale findByLocaleId(LocaleId locale)
   {
      return (HLocale) getSession().createCriteria(HLocale.class).add(Restrictions.naturalId().set("localeId", locale)).setCacheable(true).uniqueResult();
   }

   public List<HLocale> findAllActive()
   {
      return findByCriteria(Restrictions.eq("active", true));
   }

}
{'fraction_non_alphanumeric': 0.12113899613899613, 'fraction_numerical': 0.005791505791505791, 'mean_word_length': 4.83943661971831, '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': '6887667', 'n_tokens_mistral': 722, 'n_tokens_neox': 700, 'n_words': 107}